// Use this for initialization void Start() { playerObject = GameObject.FindGameObjectWithTag("Player"); player = playerObject.GetComponent <SpiritNewMovement>(); //view = GetComponent<SpriteRenderer>(); children = transform.GetComponentsInChildren <Animator>(); for (int i = 0; i < children.Length; i++) { Ani.Add(children[i]); colision.Add(transform.GetChild(i).GetComponent <BoxCollider2D>()); } if (magicPlatformType == 'A') { for (int i = 0; i < children.Length; i++) { Ani[i].SetBool("SwapBox", false); colision[i].enabled = false; } } else { for (int i = 0; i < children.Length; i++) { Ani[i].SetBool("SwapBox", true); colision[i].enabled = true; } } }
// Use this for initialization void Awake() { characterSelected = PlayerPrefs.GetInt("CharNr", 1); // get rb rb = GetComponent <Rigidbody2D>(); // sR sR = GetComponent <SpriteRenderer>(); // THE HUD (AbilityWheel) AbilityWheel = GameObject.FindGameObjectWithTag("AbilityWheel"); if (AbilityWheel != null) { WheelAnimator = AbilityWheel.GetComponent <Animator>(); } // The scripts of the other characters c0Script = GetComponent <DaughterMovement>(); c1Script = GetComponent <FatherNewMovement>(); c2Script = GetComponent <SpiritNewMovement>(); anim = GetComponent <Animator>(); curSpeed = dSpeed; changeChar(characterSelected); lastChar = characterSelected; startPosition = gameObject.transform.position; }
public char magicPlatformType = 'A'; // A default value // if it is A it will begin banish //B in case of platforms that start on the scene // Use this for initialization void Start() { playerObject = GameObject.FindGameObjectWithTag("Player"); player = playerObject.GetComponent <SpiritNewMovement>(); colision = GetComponent <BoxCollider2D>(); view = GetComponent <SpriteRenderer>(); if (magicPlatformType == 'A') { colision.enabled = false; view.enabled = false; } else { colision.enabled = true; view.enabled = true; } }