void Start() { Tutorialtext = transform.GetChild(1).GetComponent <Text>(); dataText = (TextAsset)Resources.Load("TextCsv/TutorialDialog"); string[] st = dataText.text.Split('*'); data = new List <string[]>(); for (int i = 0; i < st.Length; i++) { data.Add(st[i].Split(',')); } Tutorialtext.text = data[dialogLine][1]; BKImage = transform.Find("Bk").GetComponent <Image>(); requestImage = transform.Find("RequestImage").GetComponent <Image>(); requestImageLast = transform.Find("RequestImageLast").GetComponent <Image>(); crafterConfirm = transform.Find("CrafterConfirm").GetComponent <Image>(); attackerConfirm = transform.Find("AttackerConfirm").GetComponent <Image>(); craftRequestNumber = transform.Find("CrafterRequest").GetComponent <Text>(); attackerRequestNumber = transform.Find("AttackerRequest").GetComponent <Text>(); pickItemSystem = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>(); enemySystem = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>(); lastRequestPos = requestImageLast.transform.position; progress = -1; currentRequestPos = requestImageLast.transform.position; lastRequestPos = requestImage.transform.position; }
private void Awake() { RightAim.SetActive(false); CanonScript = transform.Find("Canon").GetComponent <Canon>(); CanonAnimator = GameObject.Find("CanonSystem").GetComponent <Animator>(); RightCanon = GameObject.Find("Canon"); Explosion = GameObject.Find("Explosion"); Explosion.SetActive(false); Rayway[0] = new Vector2(0, 1f); //上下左右 Rayway[1] = new Vector2(0, -1f); Rayway[2] = new Vector2(-1f, 0); Rayway[3] = new Vector2(1f, 0); characterVoice = GameObject.Find("CharacterAudio").GetComponent <CharacterVoice>(); enemySystem = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>(); }
// Use this for initialization void Awake() { items = new CItem[total_num]; images = new SpriteRenderer[total_num]; fire = transform.Find("fire"); for (int i = 0; i < total_num; i++) { //Debug.Log(i); images[i] = transform.GetChild(1).transform.GetChild(i).GetChild(0).GetComponent <SpriteRenderer>(); images[i].enabled = false; } animator = this.GetComponent <Animator>(); pickItemSystem = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>(); enemySystem = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>(); hint = transform.Find("hint").GetComponent <SpriteRenderer>(); hint.enabled = false; }
public void SetEnemySystem(CEnemySystem system) { enemySystem = system; }