void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); }
public void Start() { if (!audioz) { audioz = GameObject.FindWithTag("AudioStorage").GetComponent <AudioStorage>(); } customEvents = gameObject.GetComponent <CustomEvents>(); GameObject gameController = GameObject.FindWithTag("GameController"); gameControl = gameController.GetComponent <GameControl>(); gameFlow = gameController.GetComponent <GameFlow>(); moveBody = transform.parent.gameObject; if (sizeScale > 0) { setSizeScale(sizeScale); } // if (colliderScale > 0) setColliderScale(colliderScale); lifeBar = GameObject.FindWithTag("BossLife"); if (hoverBoundsUpper.Equals(Vector2.zero)) { hoverBoundsUpper = new Vector2(Screen.width / 2, Screen.height / 2); } if (hoverBoundsLower.Equals(Vector2.zero)) { hoverBoundsUpper = new Vector2(Screen.width / 2, Screen.height / 2); } StartCoroutine(Global.WaitUntilThenDo(setLifeRT, (lifeBar != null))); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
public bool sprite_on_child; //whether the visual representation of this enemy is on its child void Start() { if (!audioz) { audioz = GameObject.FindWithTag("AudioStorage").GetComponent <AudioStorage>(); } setSizeScale(sizeScale); setColliderScale(colliderScale); if (!steer) { steer = GetComponent <EnemySteering>(); } }
void Start() { setColor(Color.white.r, Color.white.g, Color.white.b); size = 1; setSize(size); curingPotency = (int)Random.Range(3, 7.99f); GameObject audioStorage = GameObject.FindWithTag("AudioStorage"); if (audioStorage) { audioz = audioStorage.GetComponent <AudioStorage>(); } if (type != 0) { randomizeRotateVelocity(); // case 0 for type will be set through setter } }