コード例 #1
0
ファイル: Wizard.cs プロジェクト: gohbwj/FYP
        void Deploy()
        {
            if (Index >= Skills.Length || Index < 0)
            {
                Index = 0;
            }

            FX_Position fx = Skills [Index].GetComponent <FX_Position> ();

            if (fx)
            {
                if (fx.Mode == SpawnMode.Static)
                {
                    Place(Skills [Index]);
                }
                if (fx.Mode == SpawnMode.OnDirection)
                {
                    PlaceDirection(Skills [Index]);
                }
            }
            else
            {
                Shoot(Skills [Index]);
            }
        }
コード例 #2
0
        void PlaceDirection(GameObject skill)
        {
            GameObject  sk = (GameObject)GameObject.Instantiate(skill, this.transform.position + this.transform.forward, skill.transform.rotation);
            FX_Position fx = sk.GetComponent <FX_Position> ();

            if (fx.Mode == SpawnMode.OnDirection)
            {
                fx.transform.forward = this.transform.forward;
            }
        }
コード例 #3
0
        void PlaceDirection(GameObject skill)
        {
            GameObject  sk = (GameObject)GameObject.Instantiate(skill, shotSpawnPoint.transform.position + shotSpawnPoint.transform.forward, skill.transform.rotation);
            FX_Position fx = sk.GetComponent <FX_Position> ();

            if (fx.Mode == SpawnMode.OnDirection)
            {
                fx.transform.forward = shotSpawnPoint.transform.forward;
            }
            magicAudio.PlayOneShot(spellAudioClip);
            Debug.Log("PlaceDirection");
            //GameObject.Destroy (sk, 3);
        }
コード例 #4
0
 void Start()
 {
     timeTemp   = Time.time;
     fx         = Skills [Index].GetComponent <FX_Position> ();
     magicAudio = GetComponent <AudioSource> ();
 }