| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class csShowAllEffect : MonoBehaviour
- {
- public string[] EffectNames;
- public string[] Effect2Names;
- public Transform[] Effect;
- public Text Text1;
- int i = 0;
- int a = 0;
- void Start()
- {
- Instantiate(Effect[i], new Vector3(0, 5, 0), Quaternion.identity);
- }
- void Update()
- {
- Text1.text = i + 1 + ":" + EffectNames[i];
- if (Input.GetKeyDown(KeyCode.Z))
- {
- if (i <= 0)
- i = 99;
- else
- i--;
- for (a = 0; a < Effect2Names.Length; a++)
- {
- if (EffectNames[i] == Effect2Names[a])
- {
- Instantiate(Effect[i], new Vector3(0, 0.01f, 0), Quaternion.identity);
- break;
- }
- }
- if (a++ == Effect2Names.Length)
- Instantiate(Effect[i], new Vector3(0, 5, 0), Quaternion.identity);
- }
- if (Input.GetKeyDown(KeyCode.X))
- {
- if (i < 99)
- i++;
- else
- i = 0;
- for (a = 0; a < Effect2Names.Length; a++)
- {
- if (EffectNames[i] == Effect2Names[a])
- {
- Instantiate(Effect[i], new Vector3(0, 0.01f, 0), Quaternion.identity);
- break;
- }
- }
- if (a++ == Effect2Names.Length)
- Instantiate(Effect[i], new Vector3(0, 5, 0), Quaternion.identity);
- }
- if (Input.GetKeyDown(KeyCode.C))
- {
- for (a = 0; a < Effect2Names.Length; a++)
- {
- if (EffectNames[i] == Effect2Names[a])
- {
- Instantiate(Effect[i], new Vector3(0, 0.01f, 0), Quaternion.identity);
- break;
- }
- }
- if (a++ == Effect2Names.Length)
- Instantiate(Effect[i], new Vector3(0, 5, 0), Quaternion.identity);
- }
- }
- }
|