Inheritance: UnityEngine.ScriptableObject
コード例 #1
0
 private void AddComponent(GameObject gameObjectTotem, TotemInstantiatorConfig totem)
 {
     if (HasAddedTotemComponents (gameObjectTotem, totem))
     {
         Totem totemObject = gameObjectTotem.GetComponent<Totem> ();
         totemObject.SetUp (totem, validStartPoints);
         AddTotemBehaviours(gameObjectTotem, totem);
     }
 }
コード例 #2
0
 private void AddTotemBehaviours(GameObject gameObjectTotem, TotemInstantiatorConfig totem)
 {
     foreach (TotemBehaviours behavioursTypes in totem.BehavioursTypes)
     {
         if(behavioursTypes == TotemBehaviours.Explosive)
             gameObjectTotem.AddComponent<TotemExplosive> ();
         else if(behavioursTypes == TotemBehaviours.HoleFiller)
             gameObjectTotem.AddComponent<TotemHoleFiller> ();
         else if(behavioursTypes == TotemBehaviours.Phantom)
             gameObjectTotem.AddComponent<TotemPhantom> ();
     }
 }
コード例 #3
0
        private bool HasAddedTotemComponents(GameObject gameObjectTotem, TotemInstantiatorConfig totem)
        {
            if (totem.Type == TotemType.Square)
                gameObjectTotem.AddComponent<SquareTotem> ();
            else if (totem.Type == TotemType.Triangle)
                gameObjectTotem.AddComponent<TriangleTotem> ();
            else if (totem.Type == TotemType.Sphere)
                gameObjectTotem.AddComponent<SphereTotem> ();
            else
                return false;

            return true;
        }
コード例 #4
0
 private void InitializeComponents(GameObject gameObjectTotem, TotemInstantiatorConfig totem, List<Node> points, Transform positionsToSnap)
 {
     MapObject mapObject = gameObjectTotem.GetComponent<MapObject> ();
     Transform startPosition = CreateStartPosition (points, totem.PositionToAdd);
     mapObject.SetStartPosition (startPosition);
     AddComponent (gameObjectTotem, totem);
 }
コード例 #5
0
ファイル: Totem.cs プロジェクト: juliancruz87/madbricks
 public void SetUp(TotemInstantiatorConfig totem, List<int> validStartPoints)
 {
     if (validTypes.Contains (totem.Type))
     {
         this.totem = totem;
         this.validStartPoints = validStartPoints;
         GameManagerForStates.StartedGame += OnStartedGame;
         controllerToStop.CollidedWithTotem += OnCrashWithOtherCollider;
         positionToGo = totem.PositionToGo;
     }
 }