Esempio n. 1
0
        private void OnHp()
        {
            float hp    = (float)Enity.GetProperty("hp");
            float maxHp = (float)Enity.GetProperty("maxHp");

            _uilifeBar.SetBarLength(hp, maxHp);
        }
Esempio n. 2
0
        private void OnActionStateEnd()
        {
            AnimatorStateInfo state = (AnimatorStateInfo)Enity.GetProperty("actinStateEnd");

            if (state.shortNameHash == AnimatorManager.atk01Hash)
            {
            }
        }
Esempio n. 3
0
        private void OnTitle()
        {
            Transform      _t        = Enity.GetProperty("title") as Transform;
            SpriteRenderer sr        = _t.GetComponent <SpriteRenderer>();
            string         titleName = Enity.GetProperty("titleName").ToString();

            sr.sprite = Resources.Load(titleName, typeof(Sprite)) as Sprite;
        }
Esempio n. 4
0
        private void LoadLifeBar()
        {
            GameObject _go = ResourceManager.Instance.LoadNewPrefab("UILifeBar2", UIMgr.Instance.GetLayer(UIMgr.Layer.layer2));

            _go.name     = "UILifeBar_" + Enity.GetProperty("name");
            barTransfrom = _go.transform as RectTransform;
            _uilifeBar   = barTransfrom.GetComponent <UILifeBar2>();
            if (_uilifeBar == null)
            {
                _uilifeBar = barTransfrom.gameObject.AddComponent <UILifeBar2>();
            }
            _uilifeBar._camera = Enity.GetProperty("camera") as Camera;
            _uilifeBar._actor  = Enity.Transform;
        }
Esempio n. 5
0
        /// <summary>
        /// 测试放在这里 添加,将来可以 以 component 形式添加
        /// </summary>
        /// <returns></returns>
        private GameObject LoadModel()
        {
            GameObject root = new GameObject(_myEnity.GetProperty("name").ToString());
            GameObject go   = GameObject.Instantiate(Resources.Load("HeroModel/Hero/A_JS_PuTong_A_001")) as GameObject;

            go.transform.SetParent(root.transform);

            CapsuleCollider collider = root.AddComponent <CapsuleCollider>();

            collider.height = 2;
            collider.center = new Vector3(0, 1, 0);
            //Rigidbody rigidbody = root.AddComponent<Rigidbody>();
            //rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionY;
            return(root);
        }
Esempio n. 6
0
        private void OnDoAction()
        {
            if (_isLock)
            {
            }
            else
            {
                string actionName = Enity.GetProperty("actionName").ToString();
                _animator.Play(actionName);
            }
            //if (AnimatorManager.Instance.IsSameCurrentAction(actionName)) return;

            /*return;
             * if (actionName == "attack01")
             * {
             *  Animator.SetBool("isAttack", true);
             * }else
             * {
             *  Animator.Play(actionName);
             * }*/
        }
Esempio n. 7
0
        private void OnActionNormalizedTime()
        {
            string actionTime = Enity.GetProperty("normalizedTime").ToString();

            if (actionTime == "effectNode")
            {
                Enity    target   = (Enity)Enity.GetProperty("patrolTarget");
                Animator animator = (Animator)target.GetProperty("animator");
                animator.Play("hit01", 0, 0);
            }
            else if (actionTime == "beAtkNode")
            {
                /*List<Enity> _listEnemy = Enity.GetProperty("enemy") as List<Enity>;
                 * if (_listEnemy != null)
                 * {
                 *  for (int i = 0; i < _listEnemy.Count; i++)
                 *  {
                 *      _listEnemy[i].SetProperty("actionName", "beAtk");
                 *  }
                 * }*/
            }
        }
Esempio n. 8
0
        bool isPlayBack = false;//是否重播  true: 重播

        private void OnMoveSpeed()
        {
            float speed = (float)(Enity.GetProperty("moveSpeed"));

            Animator.SetFloat("MoveSpeed", speed);
        }
Esempio n. 9
0
 private void OnIsLock()
 {
     _isLock = (bool)Enity.GetProperty("isLock");
 }
Esempio n. 10
0
 private void OnPatrol()
 {
     _target = Enity.GetProperty("patrolTarget") as Enity;
 }
Esempio n. 11
0
        private void OnActionStateEnd()
        {
            AnimatorStateInfo state = (AnimatorStateInfo)Enity.GetProperty("actinStateEnd");

            Debug.Log("------2 action state end " + AnimatorManager.Instance.HashToString(state.shortNameHash));
        }
Esempio n. 12
0
 private void OnDialog()
 {
     int dialogId = (int)Enity.GetProperty("dialogId");
 }
Esempio n. 13
0
        private void OnRoration()
        {
            Vector3 _v3 = (Vector3)Enity.GetProperty("rotation");

            Model.localRotation = Quaternion.LookRotation(_v3);
        }
Esempio n. 14
0
        private void OnPosition()
        {
            Vector3 _v3 = (Vector3)Enity.GetProperty("position");

            Enity.Transform.Translate(_v3);
        }
Esempio n. 15
0
 private void OnScale()
 {
     Enity.Transform.localScale = (Vector3)Enity.GetProperty("scale");
 }