Ejemplo n.º 1
0
        // 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
Ejemplo n.º 2
0
 public static void Launch(TimeSpan duration, EffectDelegate function, UserControl control)
 {
     Storyboard board = new Storyboard();
     board.Duration = duration;
     board.Completed += delegate
     {
         function(control);
     };
     board.Begin();
 }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         UnityEngine.Debug.LogError("SingleTone Error : " + this.name);
         Destroy(this);
     }
 }
Ejemplo n.º 5
0
 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();
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
    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( );
    }
Ejemplo n.º 8
0
 public Billboard(EffectDelegate eff)
 {
     e = eff;
     //bbEffect = eff;
     boardVertexBuffer = new List<VertexBuffer>();
 }
Ejemplo n.º 9
0
 public static void Initialize(EffectDelegate eff, Texture2D[] bblist, Texture2D[] activebblist, ModelDelegate disp)
 {
     effectDelegate = eff;
     billboardList = bblist;
     activeBillboardList = activebblist;
     Dispenser = disp;
 }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 public BillboardDrawingObject(Vector3 position, Texture2D texture, Vector2 dim, EffectDelegate effect)
     : this(new[] { position }, texture, dim, effect)
 {
 }
Ejemplo n.º 12
0
 public GOAPAction Effect(EffectDelegate f)
 {
     effects.Add(f);
     return(this);
 }
Ejemplo n.º 13
0
 internal Effect(EffectDelegate <TState> effect, Type actionParameterType)
 {
     _effect = effect;
     _actionParameterType = actionParameterType;
 }
Ejemplo n.º 14
0
    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);
    }
Ejemplo n.º 15
0
 public void CreateBattleFog(Vector3 worldPos, Quaternion rotation, EffectDelegate endDel)
 {
     StartCoroutine(DoCreateEffect(BattleFogTP, worldPos, rotation, 2.0f, endDel));
 }
Ejemplo n.º 16
0
 public void CreateGoldChest(Vector3 worldPos, EffectDelegate endDel)
 {
     Globals.Instance.MSoundManager.PlaySoundEffect("Sounds/UISounds/OpenChest");
     StartCoroutine(DoCreateEffect(GoldChestTP, worldPos, Quaternion.identity, 1.6f, endDel));
 }