Пример #1
0
 public static GlobalEffectPool Instacne()
 {
     if (null == global)
     {
         GameObject g = new GameObject("GlobalEffectPool");
         global = g.AddComponent <GlobalEffectPool>();
     }
     return(global);
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        time -= Time.deltaTime;

        if (time < 0)
        {
            this.gameObject.SetActive(false);
            GlobalEffectPool.Instacne().pools.Release(this.gameObject);
            GameObject.DestroyObject(this);
        }
    }
Пример #3
0
    public override void beginAction(LChatacterInterface character, LChatacterInformationInterface information)
    {
        curTime = 0f;
        //character.CrossFade(animName);
        character.ResetAndPlay(animName);
        //character.Play(animName);
        //Debug.Log("play "+ animName);
        beginPositon = character.GetCurPosition();
        endPoition   = beginPositon += MoveDir * hit_back_time * hit_back_speed;
        if (effect_obj != null)
        {
            GameObject g = GlobalEffectPool.Instacne().pools.GetObject(effect_obj);
            g.transform.position = beginPositon;
            g.transform.forward  = -MoveDir;
            AutoReleaseEffect eff = g.AddComponent <AutoReleaseEffect>();
            g.SetActive(true);
        }


        //effectId =
    }