Beispiel #1
0
        public void PlayerInteractHold(GameObject player, int target, bool enable)
        {
            Debug.Log($"CharacterHold:{enable} - {player.name}");

            int role = player.GetComponent <CharacterControl>().roleId;

            if (enable)
            {
                var commands = BabySmileManager.InteractItem(role, target);
                foreach (var(cmd, data) in commands)
                {
                    if (cmd == (int)DataCommand.StartCast)
                    {
                        PlayerStartCast(player, target, data);
                    }
                }
            }
            else
            {
                var item = InteractItems[target].GetComponent <SceneItem>();
                if (!item.HasTimerRunning)
                {
                    var commands = BabySmileManager.MissionComplete(role, target);
                    foreach (var(cmd, data) in commands)
                    {
                        ProcessCmd(cmd, player, target, data);
                    }
                }
                item.ClearTimer();
            }
        }
Beispiel #2
0
        public void PlayerInteractTap(GameObject player, int target, SceneItemType type)
        {
            Debug.Log($"CharacterTap - {player.name}, {target}");
            int role = player.GetComponent <CharacterControl>().roleId;

            var commands = type == SceneItemType.Table
                ? BabySmileManager.InteractTable(role, target)
                : BabySmileManager.InteractItem(role, target);

            foreach (var(cmd, data) in commands)
            {
                if (cmd != (int)DataCommand.StartCast)
                {
                    ProcessCmd(cmd, player, target, data);
                }
            }
        }