コード例 #1
0
ファイル: PlayerRecord.cs プロジェクト: Nachtrind/Fungus
 public static bool UnlockAbility(NodeAbility ability)
 {
     if (!unlockedAbilities.Contains(ability))
     {
         unlockedAbilities.Add(ability);
         return true;
     }
     return false;
 }
コード例 #2
0
ファイル: FungusResources.cs プロジェクト: Nachtrind/Fungus
    public void UnlockAbility(NodeAbility _toUnlock)
    {
        switch (_toUnlock.name) {
        case "growth":
            {
                growth.UnlockAbillity ();
                break;
            }
        case "slowdown":
            {
                slowdown.UnlockAbillity ();
                break;
            }
        case "speedup":
            {
                speedup.UnlockAbillity ();
                break;
            }
        case "zombie":
            {
                zombies.UnlockAbillity ();
                break;
            }

        default:
            {
                Debug.Log ("Something went wrong");
                break;
            }

        }
        UserMenu.current.UpdateEnabledAbilities ();
    }
コード例 #3
0
ファイル: GameInput.cs プロジェクト: Nachtrind/Fungus
 void Start()
 {
     plane = new Plane(Vector3.up, Vector3.zero);
     cam = Camera.main;
     currentState = InputState.NoMode;
     eventsystem = EventSystem.current;
     selectedSkill = FungusResources.Instance.attract;
 }
コード例 #4
0
ファイル: GameInput.cs プロジェクト: Nachtrind/Fungus
 public void SelectSkill(UserMenu.AbilityType _button)
 {
     currentState = InputState.SkillMode;
     switch (_button)
     {
         case UserMenu.AbilityType.Lure:
             if (FungusResources.Instance.attract.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.attract;
             }
             break;
         case UserMenu.AbilityType.Eat:
             if (FungusResources.Instance.beatneat.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.beatneat;
             }
             break;
         case UserMenu.AbilityType.Spawn:
             if (FungusResources.Instance.growth.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.growth;
             }
             break;
         case UserMenu.AbilityType.Slow:
             if (FungusResources.Instance.slowdown.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.slowdown;
             }
             break;
         case UserMenu.AbilityType.Speedup:
             if (FungusResources.Instance.speedup.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.speedup;
             }
             break;
         case UserMenu.AbilityType.Enslave:
             if (FungusResources.Instance.zombies.isUnlocked)
             {
                 selectedSkill = FungusResources.Instance.zombies;
             }
             break;
         default:
             Debug.Log("Something went wrong");
             selectedSkill = null;
             break;
     }
 }
コード例 #5
0
ファイル: FungusNode.cs プロジェクト: Nachtrind/Fungus
 protected override void OnStart()
 {
     world.SetPositionIsSlime (transform.position, StandardGameSettings.Get.nodeSlimeExtend, true);
     CreateConnections ();
     IsActive = false;
     attackTimer = 0.0f;
     abilityDisplay = GetComponentInChildren<SpriteRenderer> ();
     ability = Instantiate (ability);
 }
コード例 #6
0
ファイル: FungusNode.cs プロジェクト: Nachtrind/Fungus
 public void Specialize(NodeAbility newAbility)
 {
     ability.StopExecution (this);
     ability = Instantiate (newAbility);
     abilityDisplay.color = ability.color;
 }
コード例 #7
0
ファイル: Tutorial.cs プロジェクト: Nachtrind/Fungus
 void OnAbilityGained(NodeAbility ability)
 {
     if (EventActions.Count == 0) return;
     var he = new HookEventInfo() { LinkedAbility = ability, type = TutorialEventType.AbilityGained };
     if (CallActions(he))
     {
         AbilityBuilding.OnAbilityGained -= OnAbilityGained;
     }
 }