示例#1
0
        private static void InitContainerAction()
        {
            InteractiveAction action = (GameObject obj) =>
            {
                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Scavanging),
                                                                Resources.Load <Sprite>("Sprites/Actions/action.id.container"), () =>
                {
                    var container = obj.GetComponent <Container>();
                    ContainerUI.ShowForContainer(container);
                }, Color.green);
            };

            var containerAction = new ActionBase("action.id.container", (GameObject owner) => { return(true); }, action);

            _actions.Add("action.id.container", containerAction);
        }
示例#2
0
        private static void InitHideAction()
        {
            ActionRequirement openActionRequirement = (GameObject owner) =>
            {
                return(!PlayerQuirks.Attacked && PlayerQuirks.GetSkill(EPlayerSkills.Hiding) > 0);
            };

            InteractiveAction action = (GameObject obj) =>
            {
                var doorway = obj.GetComponent <Hideout>();

                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Hiding), doorway.Action.ActionImage, () =>
                {
                    PlayerBehaviour.CurrentPlayer.Renderer.enabled = false;
                    PlayerQuirks.Hidden = true;
                }, Color.grey);
            };

            var openDoorAction = new ActionBase(Hideout.kHideAction, openActionRequirement, action);

            _actions.Add(Hideout.kHideAction, openDoorAction);
        }
示例#3
0
        private static void InitDragAction()
        {
            var undrag = new ActionBase("action.id.undrag", (GameObject obj) => { return(true); },
                                        (GameObject obj) => { RopeDragController.Unbind(obj);
                                                              PlayerQuirks.Drags = false; });

            ActionRequirement openActionRequirement = (GameObject owner) =>
            {
                return(PlayerInventory.Instance.GetItems().Any(i => i.ItemID == "genericitem.id.rope") && !PlayerQuirks.Drags);
            };
            InteractiveAction action = (GameObject obj) =>
            {
                ProcessBarController.StartProcessWithCompletion(3f * PlayerQuirks.GetSkill(EPlayerSkills.Hiding), Resources.Load <Sprite>("Sprites/Actions/action.id.drag"), () =>
                {
                    RopeDragController.Bind(obj);
                }, Color.yellow);
            };

            var drag = new ActionBase("action.id.drag", openActionRequirement, action);

            _actions.Add(drag.ActionID, drag);
            _actions.Add(undrag.ActionID, undrag);
        }