Exemplo n.º 1
0
        public static bool Prefix(SystemTypes ENHDELNCBNG)
        {
            // Get Task
            PlayerTask playerTask = null;

            for (int i = 0; i < ShipStatus.Instance.SpecialTasks.Length; i++)
            {
                PlayerTask task = ShipStatus.Instance.SpecialTasks[i];
                if (task.StartAt == ENHDELNCBNG)
                {
                    playerTask = task;
                    break;
                }
            }

            // Check
            if (playerTask == null)
            {
                LILogger.LogError("Player has been given invalid System Task: " + ENHDELNCBNG.ToString());
                return(false);
            }

            // Provide
            PlayerControl localPlayer = PlayerControl.LocalPlayer;
            PlayerTask    playerTask2 = GameObject.Instantiate <PlayerTask>(playerTask, localPlayer.transform);

            playerTask2.Id    = 255U;
            playerTask2.Owner = localPlayer;
            playerTask2.Initialize();
            localPlayer.myTasks.Add(playerTask2);
            return(false);
        }