public static void LoadScene(int _sceneId) { Application.LoadLevel(2); // Call All Reset Statics PlayerChildFSM.ResetStatics(); PlayerMain.ResetStatics(); player_control.ResetStatics(); GameManager.ResetStatics(); EndGamePanel.ResetStatics(); PlayerSquadFSM.ResetStatics(); SquadChildFSM.ResetStatics(); Wall.ResetStatics(); WallRenderer.ResetStatics(); Nutrients.ResetStatics(); ECPoolManager.ResetStatics(); ECIdleState.ResetStatics(); DirectionDatabase.ResetStatics(); FormationDatabase.ResetStatics(); PathQuery.ResetStatics(); PointDatabase.ResetStatics(); PositionQuery.ResetStatics(); ECTracker.ResetStatics(); EnemyMainFSM.ResetStatics(); Application.LoadLevel(_sceneId); }
//A function to disable the enemy child cells by disabling the visual and collisions of the child cell and add it back into the pool private void DisableCell() { m_Child.GetComponent <SpriteRenderer>().enabled = false; m_Child.GetComponent <BoxCollider2D>().enabled = false; m_ecFSM.rigidbody2D.isKinematic = true; ECPoolManager.AddToPool(m_Child); }
void Start() { if (instance == null) { instance = this; } // GetComponent m_EMFSM = GetComponent <EnemyMainFSM> (); width = GetComponent <CircleCollider2D> ().bounds.size.x; fRadius = GetComponent <CircleCollider2D> ().bounds.size.x; position = transform.position; // Find gameObject ECPool = GameObject.Find("Enemy Child Cell Pool").GetComponent <ECPoolManager>(); // Initialise status bIsEnemyVisible = true; bIsEnemyWin = false; bCanSpawn = true; // Able to command child cells to any state by default bCanAddDefend = true; bCanAddAttack = true; bCanAddLandmine = true; }