Exemple #1
0
    /// <summary>
    /// 初始化
    /// </summary>
    protected override void Init()
    {
        base.Init();
        gameObject.SetMaskLayer(LayerMask.NameToLayer("Entourage"));
        rendererCtrl.ResetOriginalLayer(LayerMask.NameToLayer("Entourage"));
        rendererCtrl.ResetLayer();
        headTextCtrl.SetPetName(actorInfo.NoColorName);
        headTextCtrl.SetPetNameColor(actorInfo.PetNameColor);
        headTextCtrl.SetPetOwnerName(actorInfo.NoColorOwnerName);
        if (actorInfo.PetTitleName != string.Empty)
        {
            headTextCtrl.SetTitleSprite(actorInfo.PetTitleName);
        }
        MainPlayerFocus = true;
        if (aiFithtFSM == null)
        {
            aiFithtFSM = this.gameObject.GetComponent <EntourageAutoFightFSM>();
            if (aiFithtFSM == null)
            {
                aiFithtFSM = this.gameObject.AddComponent <EntourageAutoFightFSM>();
            }
            aiFithtFSM.commandMng = commandMng;
            aiFithtFSM.Init(actorInfo);
        }

        abilityMng = GameCenter.abilityMng;
        stateMachine.Start();
        stateMachine.Send((int)EventType.AI_FIGHT_CTRL);
        inited_ = true;

        if (!actorInfo.IsAlive)
        {
            Dead(true);
        }
        fxCtrl.DoShadowEffect(true);
        inited_ = true;
        if (animFSM != null)
        {
            InitAnimation();
        }
        if (moveFSM != null)
        {
            moveFSM.FaceTo(180);
        }
        if (GameCenter.sceneMng.EnterSucceed && !actorInfo.HasAwake)
        {
            GameCenter.mercenaryMng.C2S_EntrouageAwake();
        }
    }
Exemple #2
0
 public static AbilityMng CreateNew()
 {
     if (GameCenter.abilityMng == null)
     {
         AbilityMng abilityMng = new AbilityMng();
         abilityMng.Init();
         return(abilityMng);
     }
     else
     {
         GameCenter.abilityMng.UnRegist();
         GameCenter.abilityMng.Init();
         return(GameCenter.abilityMng);
     }
 }