void ActualStart() { //shipScript = GameObject.FindGameObjectWithTag("Ship").GetComponent<ScriptShipFollow>(); myParent = this.transform.parent.gameObject; if (myParent.tag == "Player") { //Debug.Log("my parent is player!"); //shipScript = myParent.transform.GetChild(2).GetComponent<ScriptShipFollow>(); if (myParent.transform.FindChild("Ships").FindChild("SPACESHIP 1").gameObject.activeSelf) { shipScript = myParent.transform.FindChild("Ships").FindChild("SPACESHIP 1").GetComponent <ScriptShipFollow>(); } else { shipScript = myParent.transform.FindChild("Ships").FindChild("siar1x").GetComponent <ScriptShipFollow>(); } //Debug.Log("Ship script: " + shipScript.gameObject.name); } else { AIScript = myParent.transform.FindChild("siar1x").GetComponent <EnemyAIController>(); } tigerShark = GameObject.Find("SPACESHIP 1"); particalSystem1 = GameObject.Find("ParticalSystem1"); particalSystem2 = GameObject.Find("ParticalSystem2"); movements = GameObject.Find("Track1World").GetComponent <ScriptEngine>().movements; //PrintInformation(); //StartCoroutine(movementEngine()); //StartCoroutine(EffectsEngine()); //StartCoroutine(FacingEngine()); startPos = this.transform.position; letsDoThis = true; }
// Use this for initialization void StartForReal() { playerDataPath = (Application.dataPath.ToString() + "/PlayerInfo/PlayerUpgrades.txt"); PopulateList(); //Debug.Log(GameObject.FindGameObjectWithTag("Player").name); shipScript = GameObject.Find("IsLocalPlayer").transform.FindChild("Ships").gameObject.transform.FindChild("siar1x").GetComponent <ScriptShipFollow>(); }
// Use this for initialization void ActualStart() { myParent = transform.parent.transform.parent.gameObject; if (myParent.tag == "Player") { shipScript = myParent.transform.FindChild("Ships").transform.FindChild("siar1x").GetComponent <ScriptShipFollow>(); } else { AIScript = myParent.transform.FindChild("siar1x").GetComponent <EnemyAIController>(); } letsDoThis = true; }
// Use this for initialization void Start() { rootObject = transform.parent.transform.parent.gameObject; if (rootObject.tag == "Enemy") { isPlayer = false; } myParent = transform.parent.gameObject; if (isPlayer) { shipScript = myParent.GetComponent <ScriptShipFollow>(); } else { AIScript = myParent.GetComponent <EnemyAIController>(); } }