Ejemplo n.º 1
0
        /// <summary>
        /// Unity Method
        /// </summary>
        private void Awake()
        {
            CommandDataEntity entity = new CommandDataEntity();

            this.DataEntity = entity;
            Watch(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Unity Method
        /// </summary>
        void Start()
        {
            InjectService.InjectInto(this);
            InitTerrain();

            CmdEntity = entityUtils.GetEntity <CommandDataEntity>(gameObject);

            StartCoroutine(UpdateCommandUIState());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加一个手机
        /// </summary>
        public void AddPhone()
        {
            CommandDataEntity     cmdEntity = (CommandDataEntity)FindObjectOfType <CommandDataModel>().DataEntity;
            CreatePhoneCommandStr str       = new CreatePhoneCommandStr();

            //随机坐标
            str.Position = new Vector3(Random.Range(-5f, 5f), 0.125f, Random.Range(-5f, 5f));
            cmdEntity.CreatePhoneMessage = str;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 添加一个塔
        /// </summary>
        public void AddTower()
        {
            CommandDataEntity     cmdEntity = (CommandDataEntity)FindObjectOfType <CommandDataModel>().DataEntity;
            CreateTowerCommandStr str       = new CreateTowerCommandStr();

            //随机坐标
            str.Position = new Vector3(Random.Range(-7, 11), Random.Range(-4, 6), Random.Range(0, 50));
            cmdEntity.CreateTowerMessage = str;
        }