Exemplo n.º 1
0
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;
        singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        eventSystem = EventSystem.current;

        eventSystem.SetSelectedGameObject(firstSelectElement);

        singleplayerScript.SetWinner (masterScript.GetCharacter(2));
        singleplayerScript.UpdateRound ();
    }
Exemplo n.º 2
0
    //____________________________________________________________\\\\\\___MonoMethods___//////_______________________________________________________________
    //_________________\\\\\\___Awake___//////_________________
    // Calculates wall positions and goal posts + sets
    // character + resets path
    //‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
    void Awake()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        gameScript = GameObject.FindObjectOfType (typeof(Game)) as Game;

        moveScript = GameObject.FindObjectOfType (typeof(Move)) as Move;
        sinCosMovementScript = GameObject.FindObjectOfType (typeof(SinCosMovement)) as SinCosMovement;
        linearRotationScript = GameObject.FindObjectOfType (typeof(LinearRotation)) as LinearRotation;
        sinCosRotationScript = GameObject.FindObjectOfType (typeof(SinCosRotation)) as SinCosRotation;

        this.name = "Projectile";

        bounceCount = 0;

        wallTop    =  fieldHeight / 2;
        wallBottom = -fieldHeight / 2;
        wallRight  =  fieldWidth  / 2;
        wallLeft   = -fieldWidth  / 2;
        goalTop    =  goalHeight  / 2;
        goalBottom = -goalHeight  / 2;

        p1char = masterScript.GetCharacter (1) - 1;
        p2char = masterScript.GetCharacter (2) - 1;

        this.ResetPath ();
    }