Esempio n. 1
0
        public static void DestroyObstacle(GenericObstacle obstacle)
        {
            foreach (GenericShip ship in Roster.AllShips.Values)
            {
                ship.LandedOnObstacles.RemoveAll(n => n == obstacle);
            }

            Instance.Obstacles.Remove(obstacle);
            Board.Objects.Remove(obstacle.ObstacleGO.GetComponentInChildren <MeshCollider>());
            GameObject.Destroy(obstacle.ObstacleGO);
        }
Esempio n. 2
0
        public static GenericObstacle GenerateObstacle(string shortName, PlayerNo playerNo)
        {
            GenericObstacle prefab      = Instance.AllPossibleObstacles.First(n => n.ShortName == shortName);
            GenericObstacle newObstacle = (GenericObstacle)Activator.CreateInstance(
                prefab.GetType(),
                new object[] { prefab.Name, prefab.ShortName }
                );

            Instance.ChosenObstacles.Add(newObstacle);
            return(newObstacle);
        }
Esempio n. 3
0
 public void DestroyObstacle(GenericObstacle obstacle)
 {
     Obstacles.Remove(obstacle);
     Board.Objects.Remove(obstacle.ObstacleGO.GetComponentInChildren <MeshCollider>());
     GameObject.Destroy(obstacle.ObstacleGO);
 }