Start() 개인적인 메소드

private Start ( ) : void
리턴 void
예제 #1
0
파일: Process.cs 프로젝트: sudoctl/colonial
        public void Input(string command)
        {
            bool commandExists = false;

            foreach (Command com in List.Commands)
            {
                if (com.command.Equals(command))
                {
                    commandExists = true;
                }
            }
            if (!commandExists)
            {
                Console.WriteLine($"> '{command}' is not a valid command");
                Program.Listen();
            }
            else
            {
                switch (command)
                {
                case "gather":
                    gather.Start();
                    break;

                case "inventory":
                    inventory.Start();
                    break;

                case "exit":
                    Console.WriteLine("!> Are you sure you want to exit? (y/n)");
                    Console.Write("!> ");
                    var readLine = Console.ReadLine();
                    if (readLine != null && readLine.ToLower().Equals("y"))
                    {
                        Environment.Exit(1);
                    }
                    Program.Listen();
                    break;

                case "help":
                    Console.WriteLine("help> Half of the journey is discovering where to go");
                    Program.Listen();
                    break;

                case "services":
                    services.Start();
                    break;

                default:
                    Console.WriteLine($"> '{command}' is not a valid command");
                    Program.Listen();
                    break;
                }
            }
        }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        inventory.Start();
        switch (asteroidSize)
        {
        case Size.Tiny:
            transform.localScale *= 0.25f;
            break;

        case Size.Small:
            transform.localScale *= 0.5f;
            break;

        case Size.Medium:
            transform.localScale *= 0.75f;
            break;

        case Size.Large:
            transform.localScale *= 1f;
            break;

        case Size.Huge:
            transform.localScale *= 1.5f;
            break;
        }
        inventory.maxVolume = Mathf.Pow(10, (int)asteroidSize);
        while (!inventory.IsFull())
        {
            Resource tempResource = Inventory.Resources[Random.Range(77, 109)];
            if (inventory.DoesContain(tempResource))
            {
                inventory[tempResource.Name].Mass += tempResource.Mass;
            }
            else
            {
                inventory.AddItem(tempResource);
            }
        }
    }
예제 #3
0
        public void SetActive(bool _value)
        {
            if (_value == true && m_Active == false && Enabled)
            {
                m_Active = true;

                Move.Altitude.Init();
                Effect.Start(OwnerComponent);
                Events.Start(OwnerComponent);
                Inventory.Start();
                Influences.Start();
            }
            else if (_value == false)
            {
                m_Active = false;

                m_Runtime = 0;

                Effect.Stop();
                Events.Stop();
                Inventory.Stop(OwnerComponent);
                Influences.Stop(OwnerComponent);
            }
        }