// create New Inits with more parameters public virtual void Init(Component component, float duration = 0, EffectDelegate OnInitEffect = null, EffectDelegate OnUpdateEffect = null, EffectDelegate OnFinishEffect = null) { EffectManager.GetPtr().RegisterEffect(component, this); OnInit += OnInitEffect; OnUpdate += OnUpdateEffect; OnFinish += OnFinishEffect; _component = component; _duration = duration; if (duration == 0) { _isInfinite = true; } if (OnInit != null) { OnInit(); } } // Init
public static void Launch(TimeSpan duration, EffectDelegate function, UserControl control) { Storyboard board = new Storyboard(); board.Duration = duration; board.Completed += delegate { function(control); }; board.Begin(); }
public void CreateBuildingChangeEffect(Vector3 worldPos, bool isCreate, EffectDelegate endDel) { if (isCreate) { StartCoroutine(DoCreateEffect(BuildingCreateTP, worldPos, Quaternion.identity, 1.5f, endDel)); } else { StartCoroutine(DoCreateEffect(BuildingDestroyTP, worldPos, Quaternion.identity, 1.5f, endDel)); } }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { UnityEngine.Debug.LogError("SingleTone Error : " + this.name); Destroy(this); } }
public static void Launch(TimeSpan duration, EffectDelegate function, UserControl control) { var board = new Storyboard { Duration = duration }; board.Completed += delegate { function(control); lock (Boards) { Boards.Remove(board); } }; lock (Boards) { Boards.Add(board); } board.Begin(); }
internal bool Set(ofNode node, EffectDelegate effect, object[] dependencies) { var pending = _node == null || dependencies?.Length == 0 || !Utils.ObjectsEqual(_dependencies, dependencies); _node = node; _element = node.Element; _dependencies = dependencies; _effect = effect; node.LocalEffects.Add(this); if (pending) { node.Root.PendingEffects.Enqueue(this); } return(pending); }
public void CreateEffect(EffectType type, Vector3 Position, EffectDelegate Delegate, bool isLeft) { Debug.Log(isLeft); EffectBase efxBase = ListEfx[(int)type]; efxBase.gameObject.SetActive(true); efxBase.transform.position = Position; Vector3 scale = efxBase.transform.localScale; if (!isLeft) { scale = new Vector3(-Mathf.Abs(scale.x), scale.y, scale.z); } else { scale = new Vector3(Mathf.Abs(scale.x), scale.y, scale.z); } efxBase.transform.localScale = scale; efxBase.Delegate = Delegate; efxBase.Play( ); }
public Billboard(EffectDelegate eff) { e = eff; //bbEffect = eff; boardVertexBuffer = new List<VertexBuffer>(); }
public static void Initialize(EffectDelegate eff, Texture2D[] bblist, Texture2D[] activebblist, ModelDelegate disp) { effectDelegate = eff; billboardList = bblist; activeBillboardList = activebblist; Dispenser = disp; }
public BillboardDrawingObject(Vector3[] positions, Texture2D texture, Vector2 dim, EffectDelegate effect) { billboard = new Billboard(effect); textures = new Texture2D[positions.Length]; for (int i = 0; i < textures.Length; i++) { textures[i] = texture; } this.positions = new List <Vector3>(positions); billboard.CreateBillboardVerticesFromList(this.positions, dim); }
public BillboardDrawingObject(Vector3 position, Texture2D texture, Vector2 dim, EffectDelegate effect) : this(new[] { position }, texture, dim, effect) { }
public GOAPAction Effect(EffectDelegate f) { effects.Add(f); return(this); }
internal Effect(EffectDelegate <TState> effect, Type actionParameterType) { _effect = effect; _actionParameterType = actionParameterType; }
protected IEnumerator DoCreateEffect(GameObject prefab, Vector3 worldPos, Quaternion rotation, float length, EffectDelegate endDel) { GameObject go = CreateEffect(prefab); go.name = prefab.name + "_Inst"; go.transform.position = worldPos; go.transform.rotation = rotation; yield return(new WaitForSeconds(length)); if (null != endDel) { endDel(go); } Destroy(go); }
public void CreateBattleFog(Vector3 worldPos, Quaternion rotation, EffectDelegate endDel) { StartCoroutine(DoCreateEffect(BattleFogTP, worldPos, rotation, 2.0f, endDel)); }
public void CreateGoldChest(Vector3 worldPos, EffectDelegate endDel) { Globals.Instance.MSoundManager.PlaySoundEffect("Sounds/UISounds/OpenChest"); StartCoroutine(DoCreateEffect(GoldChestTP, worldPos, Quaternion.identity, 1.6f, endDel)); }