Esempio n. 1
0
    int AddCountFireAction()
    {
        if (IsDoHuanDanAction)
        {
//			Debug.LogWarning("Unity:"+"IsDoHuanDanAction is true");
            return(-1);
        }

        if (IsDoRunFireAction)
        {
//			Debug.LogWarning("Unity:"+"IsDoRunFireAction is true");
            return(-1);
        }

        CountFireAction++;
        FirePoint firePointScript = NpcScript.GetFirePointScript();

        if (firePointScript != null)
        {
            CountFireRun = firePointScript.CountFire;
            CountFireRunVal++;
//			Debug.Log("Unity:"+"CountFireAction "+CountFireAction+", CountFireRunVal "+CountFireRunVal);
            if (CountFireRun <= CountFireRunVal)
            {
                //Play Run_Fire Action
                CountFireRunVal = 0;
                MakeNpcDoActionRun3();
                NpcScript.MakeNpcMoveFirePoint();
                return(0);
            }
        }

        NpcMark markScript = NpcScript.GetMarkScriptVal();

        if (NpcScript != null && markScript != null && markScript.IsDoFireAction)
        {
            CountFireRun = markScript.FireCount;
            CountFireRunVal++;
            if (CountFireRun <= CountFireRunVal)
            {
                CountFireRunVal = 0;
                MakeNpcDoActionRun3();
                NpcScript.MoveNpcByItween();
                return(0);
            }
        }

        if (CountHuanDan <= 0)
        {
            return(0);
        }

        if (CountHuanDan <= CountFireAction)
        {
            //Stop Play Fire Action.
            CountFireAction = 0;
            DelayPlayFireAction();
            SetCountHuanDan(CountFirePL, TimeRootAni);
//			PlayNPCHuanDanAction();
        }
        return(0);
    }