//Connects pigMovement scripts to control their activation states from here in GM //If you add another pig you need to add to this function! private void ConnectPigScripts() { pigLMvt = pigL.GetComponent <PigMovement> (); pigRMvt = pigR.GetComponent <PigMovement> (); pigMidVMvt = pigMidV.GetComponent <PigMovement> (); pigMidHMvt = pigMidH.GetComponent <PigMovement> (); pigMidBoxMvt = pigMidBox.GetComponent <PigMovement> (); }
void Start() { instance = this; GameObject player_go = GameObject.FindGameObjectWithTag("Player"); if(player_go == null ) { Debug.LogError("Could not find an object with tag 'Player'."); } bird = player_go.GetComponent<PigMovement>(); score = 0; highScore = PlayerPrefs.GetInt("highScore", 0); }
private void Start() { script = GetComponent <PigMovement>(); script2 = GetComponent <CharacterController2D>(); }
void Awake() { current = this; moved = false; //nav = GetComponent<NavMeshAgent>(); }