MainScript.DeployConstructionBox C# (CSharp) Метод

DeployConstructionBox() приватный Метод

Create a version of Freddy's construction box
private DeployConstructionBox ( Vector3 position, float timeToBuild ) : IEnumerator
position Vector3 Where to create the construction box
timeToBuild float Time taken to build this building. Actually, it's how long the construction box /// will be shown
Результат IEnumerator
    IEnumerator DeployConstructionBox(Vector3 position, float timeToBuild)
    {
        Transform underConstructionBox = Instantiate(prefabUnderConstructionBox, position, Quaternion.identity)
            as Transform;

        yield return new WaitForSeconds(timeToBuild);

        // Completed? Call the completed animation
        underConstructionBox.animation.Play("Complete");

        // Wait for the animation finish
        yield return new WaitForSeconds(underConstructionBox.animation["Complete"].clip.length);

        // Destroy the object
        Destroy(underConstructionBox.gameObject);
    }