Ejemplo n.º 1
0
 void Start()
 {
     KeyQ = new PerformJump();
     KeyW = new PerformKick();
     KeyE = new PerformPunch();
     anim = actor.GetComponent <Animator>();
     Camera.main.GetComponent <CameraFollow360>().player = actor.transform;
     upArrow = new MoveFoward();
 }
 void Update()
 {
     if (m_canSpawn)
     {
         IEnumerator coroutine     = CanSpawn();
         Vector3     spawnPosition = Vector3.zero;
         spawnPosition.x = Random.Range(m_leftLimit.x, m_rightLimit.x);
         spawnPosition.z = m_topLimit.z;
         GameObject go         = Instantiate(m_enemyModel, spawnPosition, Quaternion.identity);
         MoveFoward moveScript = go.AddComponent <MoveFoward>();
         moveScript.SetSpeed(m_enemySpeed);
         //Rigidbody rb = go.GetComponent<Rigidbody>();
         //rb.AddForce(go.transform.forward * -1);
     }
 }
Ejemplo n.º 3
0
    public override void skilleffect()
    {
        ModelEnum _t = (ModelEnum)_curskill._NType;

        if (!_atks [_t]._haseffect)
        {
            return;
        }

        GameObject _item = GameObject.Instantiate(GameResources.loadGameObject(_atks[_t]._atkitem._Items._NModel), GameResources.Instance()._ObjPlayer.transform) as GameObject;

        _item.transform.localPosition    = Vector3.zero;
        _item.transform.localEulerAngles = Vector3.zero;
        _item.transform.localScale       = Vector3.one;

        switch (_WeaponType)
        {
        case ModelEnum.WP_THS:

            switch (_t)
            {
            case ModelEnum.Atk_Skill_0:
                MoveFoward _mf0 = _item.AddComponent <MoveFoward> ();
                _mf0.move(new Vector3(0, 1, 1), new Vector3(0, 0, 24), 18f);
                break;

            case ModelEnum.Atk_Skill_1:
                MoveFoward _mf1 = _item.AddComponent <MoveFoward> ();
                _mf1.move(new Vector3(0, 1, 1), new Vector3(0, 0, 24), 18f);
                break;

            case ModelEnum.Atk_Skill_2:
                MoveFoward _mf = _item.AddComponent <MoveFoward> ();
                _mf.move(new Vector3(0, 1, 1), new Vector3(0, 0, 24), 18f);
                break;

            case ModelEnum.Atk_Skill_3:
                _item.transform.localPosition = new Vector3(0, 0.6f, 0);
                break;

            case ModelEnum.Atk_Skill_4:
                _item.transform.localPosition = new Vector3(0, 0, 0);
                _item.transform.localScale    = Vector3.one;
                _item.transform.SetParent(null);
                break;
            }

            break;

        case ModelEnum.WP_SHS:

            switch (_t)
            {
            case ModelEnum.Atk_Skill_0:
                MoveFoward _mf0 = _item.AddComponent <MoveFoward> ();
                _mf0.move(new Vector3(0, 1, 1), new Vector3(0, 0, 90), 18f);
                break;

            case ModelEnum.Atk_Skill_1:
                MoveFoward _mf1 = _item.AddComponent <MoveFoward> ();
                _mf1.move(new Vector3(0, 1, 1), new Vector3(0, 0, 90), 18f);
                break;

            case ModelEnum.Atk_Skill_2:
                MoveFoward _mf = _item.AddComponent <MoveFoward> ();
                _mf.move(new Vector3(0, 1, 1), new Vector3(0, 0, 90), 18f);
                break;

            case ModelEnum.Atk_Skill_3:
                _item.transform.localPosition = new Vector3(0, 0.6f, 0);
                break;

            case ModelEnum.Atk_Skill_4:
                _item.transform.localPosition = new Vector3(0, 0, 2);
                _item.transform.localScale    = Vector3.one;
                _item.transform.SetParent(null);
                break;
            }

            break;

        case ModelEnum.WP_STAFF:

            switch (_t)
            {
            case ModelEnum.Atk_Skill_0:
                MoveFoward _mf0 = _item.AddComponent <MoveFoward> ();
                _mf0.move(new Vector3(0, 1, 1.5f), Vector3.zero, 8f);
                break;

            case ModelEnum.Atk_Skill_1:
                MoveFoward _mf = _item.AddComponent <MoveFoward> ();
                _mf.move(new Vector3(0, 1, 1.5f), Vector3.zero, 8f);
                break;

            case ModelEnum.Atk_Skill_2:
                _item.transform.localPosition = new Vector3(0, 1.5f, 3.3f);
                _item.transform.SetParent(null);
                break;

            case ModelEnum.Atk_Skill_3:
                _item.transform.localPosition = new Vector3(0, 1.0f, 1.5f);
                _item.transform.SetParent(null);
                break;

            case ModelEnum.Atk_Skill_4:
                _item.transform.localPosition = new Vector3(0, 0.8f, 2);
                _item.transform.SetParent(null);
                break;
            }

            break;

        default:
            break;
        }
    }
Ejemplo n.º 4
0
 void Start()
 {
     plane = FindObjectOfType <MoveFoward>();
 }