Esempio n. 1
0
        void Start()
        {
            _MyProperty = this.gameObject.GetComponent <Ctrl_BaseEnemyProperty>();
            _Animator   = this.gameObject.GetComponent <Animator>();
            GameObject goHero = GameObject.FindGameObjectWithTag(Tag.Player);

            if (goHero)
            {
                _HeroProperty = goHero.GetComponent <Ctrl_HeroProperty>();
            }
        }
Esempio n. 2
0
        //public int Diamonds = 0;

        void Awake()
        {
            Instance = this;
            //初始化模型层的数据
            PlayerKernalDataProxy playerKernalData = new PlayerKernalDataProxy(PlayerCurrentHP, PlayerCurrentMP, PlayerCurrentAttack, PlayerCurrentDefence, PlayerCurrentDexterity, PlayerCurrentCritChance, PlayerMaxHP, PlayerMaxMP, PlayerMaxAttack, PlayerMaxDexterity, PlayerMaxDefence, PlayerMaxCritChance, AttackByProp, DefenceByProp, DexterityByProp, CritChanceByProp);


            PlayerExternalDataProxy playerExternalData = new PlayerExternalDataProxy(Exp, Level, Gold);

            PlayerPackageDataProxy playerPackageDataProxy = new PlayerPackageDataProxy(LittleBlueBottleNum, BigBlueBottleNum, LittleRedBottleNum, BigRedBottleNum);
        }
Esempio n. 3
0
		private Ctrl_SkeletonArcher_Prop _MyProperty;    //该敌人的属性


		private void Start() {
			//得到英雄、英雄的属性脚本
			_HeroGO = GameObject.FindGameObjectWithTag(Tag.Tag_Player);
			if (_HeroGO) {
				_HeroProperty = _HeroGO.GetComponent<Ctrl_HeroProperty>();
			}
			//得到该敌人、该敌人的属性脚本
			_MyGO = UnityHelper.GetInstance().SelectGOWhithTag(transform, Tag.Tag_Enemy);
			if (_MyGO) {
				_MyProperty = _MyGO.GetComponent<Ctrl_SkeletonArcher_Prop>();
			}
		}
        void Start()
        {
            _MyProperty = gameObject.GetComponent <Ctrl_BaseEnemy_Prop_Old>(); //得到本身属性
            _MyAI       = gameObject.GetComponent <Ctrl_SkeletonWarrior_AI_Old>();
            _MyAnimator = gameObject.GetComponent <Animator>();                //得到动画状态机
            goHero      = GameObject.FindGameObjectWithTag(Tag.Tag_Player);
            _cc         = this.gameObject.GetComponent <CharacterController>();

            if (goHero)
            {
                _HeroProperty = goHero.GetComponent <Ctrl_HeroProperty>();                  //得到英雄的属性脚本
            }
        }
Esempio n. 5
0
        private readonly float CON_PETime_Hurt = 2f;                   //受伤粒子特效的显示时间
        //private readonly float CON_PETime_Dead = 2f;        //死亡粒子特效的显示时间


        #region 【自动方法】

        protected virtual void Start()
        {
            //查找英雄的引用
            goHero = GameObject.FindGameObjectWithTag(Tag.Tag_Player);
            if (goHero)
            {
                _HeroProperty = goHero.GetComponent <Ctrl_HeroProperty>();
            }
            //查找自身的引用
            _MyAnimator    = gameObject.GetComponent <Animator>();
            _MyCController = this.gameObject.GetComponent <CharacterController>();
            _MyProperty    = gameObject.GetComponent <Ctrl_BaseEnemy_Prop>();
            _MyAI          = gameObject.GetComponent <Ctrl_BaseEnemy_AI>();
        }
Esempio n. 6
0
        // Use this for initialization
        void Start()
        {
            _MyTransform = this.gameObject.transform;

            /* 确定敌人的个体差异性的数值 */
            MoveSpeed           = UnityHelper.GetInstance().RandomNum(3, 4);
            EnemyAttackDistance = UnityHelper.GetInstance().RandomNum(10, 15);
            EnemyCordonDistance = UnityHelper.GetInstance().RandomNum(35, 40);
            EnemyThinkTime      = UnityHelper.GetInstance().RandomNum(1, 2);

            //得到当前主角
            _Hero = GameObject.FindGameObjectWithTag("Player");
            //得到主角属性
            _HeroProperty = _Hero.GetComponent <Ctrl_HeroProperty>();
            //得到当前属性实例
            _MyProperty = this.gameObject.GetComponent <Ctrl_BaseEnemyProperty>();
            //得到角色控制器
            _CharacterController = this.gameObject.GetComponent <CharacterController>();
        }
Esempio n. 7
0
 private void Awake()
 {
     Instance = this;                    //得到本类引用
 }
        public int IntDiamonds = 0;                                            //当前钻石

        void Awake()
        {
            Instance = this;
        }