예제 #1
0
        // 施法 add by TangJian 2017/08/09 19:00:22
        public virtual void OnEvtSkill()
        {
            // 攻击帧事件 add by TangJian 2017/07/13 23:23:07
            var clipInfoArray = _animator.GetCurrentAnimatorClipInfo(0);
            var clipInfo      = clipInfoArray[0];
            var animName      = clipInfo.clip.name;

            switch (animName)
            {
            case "staff_atk1":
            {
                // 发射火球术
                var fireBall = GameObjectManager.Instance.Spawn("FireBall");

                fireBall.transform.parent        = transform.parent;
                fireBall.transform.localPosition = transform.localPosition + new Vector3(0, 1, 0);

                FireBallController fireBallController = fireBall.GetComponent <FireBallController>();
                fireBallController.speed = new Vector3(GetDirectionInt() * 10, 0, 0);

                fireBallController.DamageController.damageData.owner            = gameObject;
                fireBallController.DamageController.damageData.itriggerDelegate = this;
            }
            break;
            }
        }
예제 #2
0
파일: DebugInput.cs 프로젝트: linxscc/bnyx
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.F1))
            {
                switchScene();
            }

            if (Input.GetKeyDown(KeyCode.F2))
            {
                createEnemy();
            }

            if (Input.GetKeyDown(KeyCode.F3))
            {
                dropWeapon();
            }

            if (Input.GetKeyDown(KeyCode.F4))
            {
                // dropCoin();
                // dropJar();

                // createItem("Box", true);
                createItem("Jar", true);
                // createItem("TreasureBox", true);
            }

            if (Input.GetKeyDown(KeyCode.F5))
            {
                //UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene");
                UnityEngine.SceneManagement.SceneManager.LoadScene("GameScenewudi1");
            }

            if (Input.GetKeyDown(KeyCode.F6))
            {
                var player         = GameObject.Find("Player");
                var roleController = player.GetComponent <RoleController>();

                // 发射火球术
                var fireBall = GameObjectManager.Instance.Spawn("FireBall");

                fireBall.transform.parent        = transform.parent;
                fireBall.transform.localPosition = transform.localPosition + new Vector3(roleController.GetDirectionInt() * 3, 0.5f, 0);

                FireBallController fireBallController = fireBall.GetComponent <FireBallController>();
                fireBallController.speed = new Vector3(roleController.GetDirectionInt() * 20, 0, 0);

                fireBallController.DamageController.damageData.owner = gameObject;
            }

            if (Input.GetKeyDown(KeyCode.F12))
            {
            }
        }