Beispiel #1
0
    public override bool Update(float delta, Fish fish, out bool bRemove)
    {
        float x = Camera.main.WorldToScreenPoint(fish.Position).x;

        if (m_LeftToRight)
        {
            x /= Screen.width;
        }
        else
        {
            x = (Screen.width - x) / Screen.width;
        }

        float delay = x * 1.5f + 1.1f;

        if (delay <= m_Timer.LifeTime || m_Timer.IsEnd)
        {
            fish.StopLaugh(false);
            if (fish.ExtraData != null)
            {
                GlobalEffectData gfd = (GlobalEffectData)fish.ExtraData;
                fish.ExtraData = null;
                gfd.Life       = 0;
            }
            float transRot = -Utility.Range(100, 200);
            float pathRot  = -Utility.Range(300, 500);
            float speed    = Utility.Range(15, 20) * SceneRuntime.ComputeZScaling(fish, 1.0f);

            FishOptPath fop = new FishOptPath(PathManager.Instance.BoLang, transRot, pathRot, speed, 0, fish.Position, true);
            fop.SetDeadData(0, false, null);
            fish.AddOpt(fop);
            bRemove = true;
        }
        else
        {
            bRemove = false;
        }
        return(true);
    }
Beispiel #2
0
    public bool Finish(Fish fish)
    {
        if (DeadType == FishDeadType.DEAD_ACTION)
        {
            if (OptType == FishOptType.FOT_ACTION)
            {
                LogMgr.Log("Action不能再使用死亡动作");
                return(true);
            }
            fish.OrgSpeed = 0.0f;
            FishOptAction foa = new FishOptAction(FishClipType.CLIP_SIWANG, 1.0f, false);
            foa.DeadType  = FishDeadType.DEAD_IMMEDIATE;
            foa.CatchData = CatchData;
            fish.AddOpt(foa);

            if (m_CatchData != null)
            {
                ++m_CatchData.DeadNum;
                SceneRuntime.EffectMgr.FishCatched(fish, m_CatchData);
            }
            return(true);
        }
        else if (DeadType == FishDeadType.DEAD_IMMEDIATE)
        {
            //调用接口
            if (OptType != FishOptType.FOT_ACTION && m_CatchData != null)
            {
                ++m_CatchData.DeadNum;
                SceneRuntime.EffectMgr.FishCatched(fish, m_CatchData);
            }

            return(false);
        }
        else
        {
            return(true);
        }
    }