Esempio n. 1
0
 private void Start()
 {
     bottomPlayer = GameObject.Find("Player 1").GetComponent <CameraOneRotator>();
     topPlayer    = GameObject.Find("Player 2 Camera").GetComponent <CameraTwoRotator>();
     floor        = topPlayer.GetFloor();
     face         = topPlayer.GetState();
 }
Esempio n. 2
0
    //private bool ghost = true;
    // Use this for initialization
    void Start()
    {
        prefab   = Resources.Load("projectile") as GameObject;
        trapBase = GetComponent <TrapBase>();
        cam      = GameObject.Find("Player 2 Camera").GetComponent <CameraTwoRotator>();
        animator = GetComponentInChildren <Animator>();

        if (!GetComponentInChildren <CheckMultipleBases>().Placed)
        {
            switch (cam.GetState())
            {
            case 1:
                transform.eulerAngles = new Vector3(0, 0, 0);
                projectileRotation    = Quaternion.identity;
                velocity = new Vector3(-20, 0, 0);
                break;

            case 2:
                transform.eulerAngles = new Vector3(0, 270, 0);
                projectileRotation    = Quaternion.Euler(0, -90, 0);
                velocity = new Vector3(0, 0, -20);
                break;

            case 3:
                transform.eulerAngles = new Vector3(0, 180, 0);
                projectileRotation    = Quaternion.Euler(0, -180, 0);
                velocity = new Vector3(20, 0, 0);
                break;

            case 4:
                transform.eulerAngles = new Vector3(0, 90, 0);
                projectileRotation    = Quaternion.Euler(0, -270, 0);
                velocity = new Vector3(0, 0, 20);
                break;
            }
        }
        else
        {
            switch (FaceNumberIfPrePlaced)
            {
            case 1:
                transform.eulerAngles = new Vector3(0, 0, 0);
                projectileRotation    = Quaternion.identity;
                velocity = new Vector3(-20, 0, 0);
                break;

            case 2:
                transform.eulerAngles = new Vector3(0, 270, 0);
                projectileRotation    = Quaternion.Euler(0, -90, 0);
                velocity = new Vector3(0, 0, -20);
                break;

            case 3:
                transform.eulerAngles = new Vector3(0, 180, 0);
                projectileRotation    = Quaternion.Euler(0, -180, 0);
                velocity = new Vector3(20, 0, 0);
                break;

            case 4:
                transform.eulerAngles = new Vector3(0, 90, 0);
                projectileRotation    = Quaternion.Euler(0, -270, 0);
                velocity = new Vector3(0, 0, 20);
                break;
            }
        }
    }