Exemplo n.º 1
0
Arquivo: Wizard.cs Projeto: 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]);
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 void Start()
 {
     timeTemp   = Time.time;
     fx         = Skills [Index].GetComponent <FX_Position> ();
     magicAudio = GetComponent <AudioSource> ();
 }