OpenDoor.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        Rotate_X = transform.localEulerAngles.x;
        Rotate_Y = transform.localEulerAngles.y;
        Rotate_Z = transform.localEulerAngles.z;

        player = GameObject.FindGameObjectWithTag("Greta");

        ASPath = GameObject.Find("AstarPathing01").GetComponent<AstarPath>();
        //gm = GameObject.Find("Person/Main Camera").GetComponent<GameMenu>();
        //gm = Camera.current.GetComponent<GameMenu>();
        gm = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<GameMenu>();

        OpeningSpeed = 1.75f;

        //if (DoorBlinTexture[2])
        //this.renderer.material.SetTexture("_MainTex", DoorBlinTexture[2]);
    }

Usage Example

示例#1
0
        //
        // This is Event Handler for the request button which is located in the first floor.
        //
        private void down_Click(object sender, EventArgs e)
        {// If the vertical location of the Elevator is equal to y = 95, the 'OpenDoor' timer will start. Otherwise, 'CloseDoor' timer will start.
            if (Elevator.Top == 95)
            {
                drOpen = true;
                // This insert command will be saved into string data type (Sqlcommand).
                // Afterwards, it will call the connection method to execute the 'Sqlcommand' which is stored in the data type.
                Sqlcommand = "INSERT INTO Log ( [Action], [Date] ) values ('Door is opening in first Floor', ' " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "')";

                Connection();
                OpenDoor.Start();// It will call the 'OpenDoor' Event Handler.
            }
            else
            {
                drClose = true;
                button  = false;
                close   = false;
                lightOn = false;
                // This insert command will be saved into string data type (Sqlcommand).
                // Afterwards, it will call the connection method to execute the 'Sqlcommand' which is stored in the data type.
                Sqlcommand = "INSERT INTO Log ( [Action], [Date] ) values ('Door is closing in first Floor', ' " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "')";

                Connection();

                CloseDoor.Start();// The 'CloseDoor' timer will start therefore, means it will call the 'CloseDoor' Event Handler.
            }
        }
All Usage Examples Of OpenDoor::Start