public void OnBack() { //Debug.Log("gameobject : " + this.name); //Debug.Log("de activate: " + gameObject.name); //Debug.Log("activate: " + PlayerMesh.name); //Debug.Log("activate: " + PlayerSelection.name); gameObject.SetActive(false); PlayerMesh.SetActive(true); PlayerSelection.SetActive(true); }
void Awake() { transform.parent = General.GetParent("Players"); gameController = GameObject.FindObjectOfType <GameController>(); spriteRenderer = transform.FindChild("Sprite").GetComponent <SpriteRenderer>(); selection = GetComponentInChildren <PlayerSelection>(); selection.SetActive(false); thisRigidbody = GetComponent <Rigidbody2D>(); mass = thisRigidbody.mass; playerIA = GetComponent <PlayerIA>(); SetAiming(false); // In the start the player is not playable // Wait for the start SetNonPlayable(); }
void SetAiming(bool aiming) { isAiming = aiming; selection.SetActive(aiming); }