コード例 #1
0
ファイル: Stand.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     if (action == TriggerAction.TYPE.InsertToStand)
     {
         this.m_NumItems++;
         this.PlayInsertSound();
         this.UpdateVis();
         if (ItemsManager.Get().IsHeavyObject(this.m_StoredItemId))
         {
             this.RemoveItemFromHand();
             return;
         }
         this.RemoveItemFromBackpack();
         return;
     }
     else
     {
         if (action == TriggerAction.TYPE.Expand)
         {
             base.OnExecute(action);
             return;
         }
         if (action == TriggerAction.TYPE.Take)
         {
             this.Take();
         }
         return;
     }
 }
コード例 #2
0
ファイル: InputsManager.cs プロジェクト: looki666/Green-Hell
    public void LoadSettings(BinaryFormatter bf, FileStream file)
    {
        Dictionary <int, int> dictionary  = new Dictionary <int, int>();
        Dictionary <int, int> dictionary2 = new Dictionary <int, int>();
        int num = (int)bf.Deserialize(file);

        for (int i = 0; i < num; i++)
        {
            string value = (string)bf.Deserialize(file);
            InputsManager.InputAction key   = (InputsManager.InputAction)Enum.Parse(typeof(InputsManager.InputAction), value);
            string          value2          = (string)bf.Deserialize(file);
            KeyCode         value3          = (KeyCode)Enum.Parse(typeof(KeyCode), value2);
            InputActionData inputActionData = null;
            if (this.m_ActionsByInputAction.TryGetValue((int)key, out inputActionData))
            {
                dictionary.Add((int)key, (int)value3);
            }
        }
        int num2 = (int)bf.Deserialize(file);

        for (int j = 0; j < num2; j++)
        {
            string             value4           = (string)bf.Deserialize(file);
            TriggerAction.TYPE key2             = (TriggerAction.TYPE)Enum.Parse(typeof(TriggerAction.TYPE), value4);
            string             value5           = (string)bf.Deserialize(file);
            KeyCode            value6           = (KeyCode)Enum.Parse(typeof(KeyCode), value5);
            InputActionData    inputActionData2 = null;
            if (this.m_ActionsByTriggerAction.TryGetValue((int)key2, out inputActionData2))
            {
                dictionary2.Add((int)key2, (int)value6);
            }
        }
        this.ApplyOptions(dictionary, dictionary2);
    }
コード例 #3
0
 public void OnTriggerHoldStart(TriggerAction.TYPE action)
 {
     if (action == TriggerAction.TYPE.Deconstruct && this.m_AudioSource != null && !this.m_AudioSource.isPlaying)
     {
         this.m_AudioSource.PlayOneShot(this.m_DeconstructHoldClips[UnityEngine.Random.Range(0, this.m_DeconstructHoldClips.Count)]);
     }
 }
コード例 #4
0
ファイル: Bowl.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Pour)
     {
         base.Fill(LiquidInHandsController.Get().m_Container);
         return;
     }
     if (action == TriggerAction.TYPE.Drink)
     {
         this.Drink();
         if (((LiquidContainerInfo)this.m_Info).m_Amount == 0f)
         {
             if (this.m_Item)
             {
                 UnityEngine.Object.Destroy(this.m_Item.gameObject);
                 this.m_Item = null;
             }
             this.m_ItemSlot.gameObject.SetActive(false);
             if (this.m_ItemVis)
             {
                 this.m_ItemVis.gameObject.SetActive(false);
                 this.m_ItemVis = null;
             }
             this.SetState(Bowl.State.None);
         }
     }
 }
コード例 #5
0
ファイル: Trigger.cs プロジェクト: Blightbuster/Green-Hell
 public virtual void OnExecute(TriggerAction.TYPE action)
 {
     if (this.m_RequiredItems.Count > 0 && this.m_DestroyRequiredItemsOnExecute)
     {
         foreach (ItemID item_id in this.m_RequiredItems)
         {
             Item item = InventoryBackpack.Get().FindItem(item_id);
             if (item)
             {
                 if (item.m_InventorySlot && item.m_InventorySlot.m_Items.Count > 0)
                 {
                     UnityEngine.Object.Destroy(item.m_InventorySlot.m_Items[0].gameObject);
                 }
                 else
                 {
                     UnityEngine.Object.Destroy(item.gameObject);
                 }
             }
         }
     }
     if (!this.m_WasTriggered)
     {
         this.m_WasTriggered     = true;
         this.m_FirstTriggerTime = MainLevel.Instance.m_TODSky.Cycle.GameTime;
     }
     if (this.m_Owner != null)
     {
         this.m_Owner.OnExecute(this, action);
         return;
     }
     this.TryPlayExecuteSound();
 }
コード例 #6
0
 public void OnTriggerHoldEnd(TriggerAction.TYPE action)
 {
     if (this.m_AudioSource != null && this.m_AudioSource.isPlaying)
     {
         this.m_AudioSource.Stop();
     }
 }
コード例 #7
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Insert)
     {
         Item currentItem = Player.Get().GetCurrentItem(Hand.Right);
         if (currentItem && this.m_ItemID == currentItem.GetInfoID() && currentItem.m_Info.IsHeavyObject())
         {
             HeavyObject heavyObject = (HeavyObject)currentItem;
             if (heavyObject.m_Attached.Count > 0)
             {
                 this.Fulfill(false);
                 heavyObject.DetachHeavyObject(0, true);
                 return;
             }
             HeavyObjectController.Get().InsertToGhostSlot(this);
             return;
         }
         else
         {
             this.Fulfill(false);
             InventoryBackpack.Get().RemoveItem(this.m_ItemID, 1);
         }
     }
 }
コード例 #8
0
ファイル: DeadBody.cs プロジェクト: looki666/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Take)
     {
         Item item = ItemsManager.Get().CreateItem(this.m_AIID.ToString() + "_Body", false);
         item.transform.rotation = base.transform.rotation;
         item.transform.position = base.transform.position;
         if (this.m_AIID == AI.AIID.PoisonDartFrog)
         {
             List <Renderer> componentsDeepChild = General.GetComponentsDeepChild <Renderer>(base.gameObject);
             Material        material            = null;
             for (int i = 0; i < componentsDeepChild.Count; i++)
             {
                 material = componentsDeepChild[i].material;
             }
             item.ApplyMaterial(material);
         }
         item.Take();
         UnityEngine.Object.Destroy(base.gameObject);
     }
     else if (action == TriggerAction.TYPE.Harvest)
     {
         Player.Get().HideWeapon();
         HarvestingAnimalController.Get().SetBody(this);
         Player.Get().StartController(PlayerControllerType.HarvestingAnimal);
     }
     else if (action == TriggerAction.TYPE.RemoveFromSnareTrap && this.m_AI)
     {
         this.m_AI.StartRagdoll();
         UnityEngine.Object.Destroy(this.m_AI.GetComponent <AI>());
         UnityEngine.Object.Destroy(this.m_AI.GetComponent <Animator>());
         this.m_Trap = null;
     }
 }
コード例 #9
0
ファイル: InputsManager.cs プロジェクト: looki666/Green-Hell
    public InputActionData GetInputActionData(TriggerAction.TYPE action)
    {
        InputActionData result = null;

        this.m_ActionsByTriggerAction.TryGetValue((int)action, out result);
        return(result);
    }
コード例 #10
0
 public void OnExecute(Trigger trigger, TriggerAction.TYPE action)
 {
     if (trigger == this.m_BloodTrigger)
     {
         this.SetState(CureMachine.State.BloodInserted);
     }
 }
コード例 #11
0
ファイル: InputsManager.cs プロジェクト: looki666/Green-Hell
 public void SaveSettings(BinaryFormatter bf, FileStream file)
 {
     bf.Serialize(file, this.m_ActionsByInputAction.Keys.Count);
     for (int i = 0; i < this.m_ActionsByInputAction.Keys.Count; i++)
     {
         int num = this.m_ActionsByInputAction.Keys.ElementAt(i);
         InputsManager.InputAction inputAction = (InputsManager.InputAction)num;
         string graph = inputAction.ToString();
         bf.Serialize(file, graph);
         KeyCode keyCode = this.m_ActionsByInputAction.Values.ElementAt(i).m_KeyCode;
         string  graph2  = keyCode.ToString();
         bf.Serialize(file, graph2);
     }
     bf.Serialize(file, this.m_ActionsByTriggerAction.Keys.Count);
     for (int j = 0; j < this.m_ActionsByTriggerAction.Keys.Count; j++)
     {
         int num2 = this.m_ActionsByTriggerAction.Keys.ElementAt(j);
         TriggerAction.TYPE type   = (TriggerAction.TYPE)num2;
         string             graph3 = type.ToString();
         bf.Serialize(file, graph3);
         KeyCode keyCode2 = this.m_ActionsByTriggerAction.Values.ElementAt(j).m_KeyCode;
         string  graph4   = keyCode2.ToString();
         bf.Serialize(file, graph4);
     }
 }
コード例 #12
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     this.PlayArmSound();
     this.SetArmed(true);
     this.m_LastCheck = Time.time;
 }
コード例 #13
0
 public void OnExecute(Trigger trigger, TriggerAction.TYPE action)
 {
     this.m_Trigger.m_BoxCollider.enabled = false;
     this.m_ClosedObject.SetActive(false);
     this.m_OpenObject.SetActive(true);
     this.m_Trigger.TryPlayExecuteSound();
     this.m_State = LootBox.State.Open;
 }
コード例 #14
0
 public static int GetActionId(this InputsManager.InputAction action, TriggerAction.TYPE trigger = TriggerAction.TYPE.None)
 {
     if (trigger != TriggerAction.TYPE.None)
     {
         return((int)(117 + trigger));
     }
     return((int)action);
 }
コード例 #15
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (!GreenHellGame.ROADSHOW_DEMO && action == TriggerAction.TYPE.Sleep)
     {
         SleepController.Get().StartSleeping(this, true);
     }
 }
コード例 #16
0
    public InputActionData GetInputActionData(TriggerAction.TYPE trigger)
    {
        InputActionData[] array = null;
        int actionId            = InputHelpers.GetActionId(trigger);

        this.m_ActionsByInputAction.TryGetValue(actionId, out array);
        return(array[(int)GreenHellGame.Instance.m_Settings.m_ControllerType]);
    }
コード例 #17
0
ファイル: Storage.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Use)
     {
         Storage3D.Get().Activate(this);
     }
 }
コード例 #18
0
ファイル: Boat.cs プロジェクト: looki666/Green-Hell
    public override void OnExecute(TriggerAction.TYPE action)
    {
        base.OnExecute(action);
        BoatController component = Player.Get().GetComponent <BoatController>();

        component.SetBoat(this);
        Player.Get().StartController(PlayerControllerType.Boat);
    }
コード例 #19
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Deconstruct)
     {
         this.Deconstruct();
     }
 }
コード例 #20
0
ファイル: Spikes.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Arm)
     {
         this.Arm(true);
     }
 }
コード例 #21
0
ファイル: MudMixer.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Use)
     {
         this.SetState(MudMixer.State.Mix);
     }
 }
コード例 #22
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     this.m_Animator.SetTrigger(this.m_RClapOpenHash);
     if (this.m_State == CureMachine.State.Fail)
     {
         this.SetState(CureMachine.State.Reset);
     }
 }
コード例 #23
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Drink)
     {
         this.Drink();
     }
 }
コード例 #24
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Ignite)
     {
         TorchController.Get().OnDynamiteIgnite(this);
     }
 }
コード例 #25
0
 public InputActionData GetActionDataByTriggerAction(TriggerAction.TYPE trigger_action, ControllerType controller_type = ControllerType._Count)
 {
     InputActionData[] array;
     if (this.m_ActionsByInputAction.TryGetValue(InputHelpers.GetActionId(trigger_action), out array))
     {
         return(array[(int)((controller_type == ControllerType._Count) ? GreenHellGame.Instance.m_Settings.m_ControllerType : controller_type)]);
     }
     return(null);
 }
コード例 #26
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.UseHold)
     {
         this.m_Line.SetActive(true);
         this.m_Activated = true;
     }
 }
コード例 #27
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Harvest)
     {
         this.m_AI.m_HealthModule.Die();
         base.gameObject.GetComponent <DeadBody>().OnExecute(action);
     }
 }
コード例 #28
0
 public void OnExecute(Trigger trigger, TriggerAction.TYPE action)
 {
     AnimationTriggerController.Get().SetTrigger(this);
     Player.Get().StartController(PlayerControllerType.AnimationTrigger);
     if (this.m_Sound && this.m_AudioSource)
     {
         this.m_AudioSource.clip = this.m_Sound;
         this.m_AudioSource.Play();
     }
 }
コード例 #29
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action != TriggerAction.TYPE.Read)
     {
         return;
     }
     HUDReadableItem.Get().Activate(base.gameObject.name, this);
     this.m_WasReaded = true;
 }
コード例 #30
0
ファイル: Shower.cs プロジェクト: Blightbuster/Green-Hell
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (this.m_Active)
     {
         this.TurnOff();
         return;
     }
     this.TurnOn();
 }