예제 #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> ();
 }