// Use this for initialization
        void Start()
        {
            SignalFactory.GetInstance <WarBuildChangeLegion>().AddListener(changeLegion);
            Vector3 v11 = new Vector3(0f, 6f, -6f);
            Vector3 v21 = new Vector3(-1f, 6f, -6f);
            Vector3 v22 = new Vector3(1f, 6f, -6f);
            Vector3 v31 = new Vector3(-1f, 8.5f, -6f);
            Vector3 v32 = new Vector3(1f, 8.5f, -6f);
            Vector3 v33 = new Vector3(-1f, 5.5f, -6f);
            Vector3 v41 = new Vector3(-1f, 8.5f, -6f);
            Vector3 v42 = new Vector3(1f, 8.5f, -6f);
            Vector3 v43 = new Vector3(-1f, 5.5f, -6f);
            Vector3 v44 = new Vector3(1f, 5.5f, -6f);

            buffPosDic[11] = v11;
            buffPosDic[21] = v21;
            buffPosDic[22] = v22;
            buffPosDic[31] = v31;
            buffPosDic[32] = v32;
            buffPosDic[33] = v33;
            buffPosDic[41] = v41;
            buffPosDic[42] = v42;
            buffPosDic[43] = v43;
            buffPosDic[44] = v44;
        }
Exemple #2
0
 void OnEnable()
 {
     if (state == StarState.Doing)
     {
         SignalFactory.GetInstance <WarBuildChangeLegion>().AddListener(OnBuildChangeTeam);
     }
 }
Exemple #3
0
 /** 兵营改变势力 */
 public void OnBuildChangeTeam(UnitData buildUnitData, int preTeam, int targetTeam)
 {
     if (buildUnitData.initLegionId == War.ownLegionData.legionId && buildUnitData.heroData != null)
     {
         state = StarState.Fail;
         SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(OnBuildChangeTeam);
     }
 }
Exemple #4
0
        public void OnButtonClick()
        {
            SignalFactory.GetInstance <GMSignal>().Dispatch(vo, meInput.text);

//            C_GM_GameCommand_0x40 msg = new C_GM_GameCommand_0x40();
//            msg.content = vo.enPart + " " + meInput.label.text;
//            Debugger.Log("GM : " + msg.content);
//            packetManager.SendMessage<C_GM_GameCommand_0x40>(msg);
        }
Exemple #5
0
        protected override void OnAwake()
        {
            base.OnAwake();
            Init();
            // 初始化更新器
            InitUpdateHandle();

            // 监听--建筑归属改变
            SignalFactory.GetInstance <WarBuildChangeLegion>().AddListener(OnBuildChangeLegion);
        }
Exemple #6
0
 protected override void OnDestroy()
 {
     Debug.LogFormat("<color=wihte> war scene destorey</color>");
     //Coo.plotTalkManager.cleanTipsInfo();
     base.OnDestroy();
     StopAllCoroutines();
     CearPathCache();
     SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(OnBuildChangeLegion);
     if (War.scene == this)
     {
         War.scene = null;
     }
 }
        public void BuildChangeLegion(int legionId)
        {
            RevokeBuildSpotConfig();
            if (buildLevelConfig != null)
            {
                RemoveBuildModule(buildLevelConfig.basepropConfig);
                RemoveBuildModule(buildLevelConfig.produceConfig);
                RemoveBuildModule(buildLevelConfig.turretConfig);
                RemoveBuildModule(buildLevelConfig.spotConfig);
            }

            int preLegionId = this.legionId;

            float hp = this.hp;

            this.legionId = legionId;
            this.RevokeAll();
            SignalFactory.GetInstance <WarBuildChangeLegion>().Dispatch(this, preLegionId, this.legionId);
            this.changeTeaming = true;
            if (this.level > 1)
            {
                this.level -= 1;
            }
            build_addMaxLevel = 0;

            avatarConfig = buildLevelConfig.avatarConfig;

            // 势力--战前属性
            this.AppProps(legionData.buildInitAttachPropData);
            // 势力--附加建筑属性
            legionData.buildPropContainer.UnitApp(this);

            AppBuildModules();

            AddBuildModule(buildLevelConfig.basepropConfig);
            AddBuildModule(buildLevelConfig.produceConfig);
            AddBuildModule(buildLevelConfig.turretConfig);
            AddBuildModule(buildLevelConfig.spotConfig);

            // 建筑初始属性  InitHP
            this.AppProps(War.sceneData.GetBuildInitProps(id), true);

            this.hp = hp;
            if (float.IsNaN(hp))
            {
                Debug.Log(string.Format("<color=red>hp={0}</color>", hp));
            }

            sos = false;
        }
Exemple #8
0
 void OnDisable()
 {
     SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(OnBuildChangeTeam);
 }
 public void SetFail()
 {
     state = StarState.Fail;
     SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(OnBuildChangeTeam);
 }
 public override void SetSuccess()
 {
     base.SetSuccess();
     SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(OnBuildChangeTeam);
 }
Exemple #11
0
 void Awake()
 {
     SignalFactory.GetInstance <GMSignal>().AddListener(OnGM);
 }
 void OnDisable()
 {
     SignalFactory.GetInstance <WarDarkScreenVisible>().RemoveListener(Set);
 }
 void OnEnable()
 {
     Set(War.darkScreenVisible);
     SignalFactory.GetInstance <WarDarkScreenVisible>().AddListener(Set);
 }
 void OnDestroy()
 {
     SignalFactory.GetInstance <WarBuildChangeLegion>().RemoveListener(changeLegion);
 }
 void OnTweenHideComplete()
 {
     Alhpa = 0F;
     UpdateView();
     SignalFactory.GetInstance <MsgScrollCompleteSignal>().Dispatch();
 }