Skip to content

Instantly share code, notes, and snippets.

#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace Custom.Scripts
{
[InitializeOnLoad]
static class PlayMainScene_PrevSceneAutoLoader
{
@c0ffeeartc
c0ffeeartc / DestroyWith.cs
Last active January 17, 2021 17:24
EventDriven/SystemLess DestroyWith feature for Entitas ECS framework
using System;
using Entitas;
using Entitas.CodeGeneration.Attributes;
[Context( Ids.Game )]
[Context(Ids.GameState)] // second context to force generation of EntityApiInterface
public class DestroyWith_Emit : IComponent
{
public Int32 Value;
}
using System;
using UnityEngine;
public interface ITransformController
{
Vector3 PosWorld { get; set; }
Vector3 PosLocal { get; set; }
Quaternion RotWorld { get; set; }
Quaternion RotLocal { get; set; }
Vector3 ScaleLocal { get; set; }
import macros
# macro debug(c: varargs[expr]): stmt =
# result = newNimNode(nnkStmtList, c)
# for i in 0..c.len-1:
# # add a call to the statement list that writes the expression;
# # `toStrLit` converts an AST to its string representation:
# result.add(newCall("write", newIdentNode("stdout"), toStrLit(c[i])))
# # add a call to the statement list that writes ": "
# result.add(newCall("write", newIdentNode("stdout"), newStrLitNode(": ")))
bl_info = {
"name" : "Select Mode Pie Menu",
"author" : "Stan Pancakes",
"version" : (0, 1, 0),
"blender" : (2, 72, 0),
"description" : "Custom Pie Menus",
"category" : "3D View",}
import bpy
#include <iostream>
class ScopeSwapOStream
{
public:
ScopeSwapOStream(const ScopeSwapOStream&&) = delete;
ScopeSwapOStream(const ScopeSwapOStream&) = delete;
ScopeSwapOStream& operator=(const ScopeSwapOStream&&) = delete;
ScopeSwapOStream& operator=(const ScopeSwapOStream&) = delete;