Beispiel #1
0
    private void Start()
    {
        snapToObject   = null;
        player         = GetComponent <Player>();
        playerMovement = GetComponent <IPlayerMovement>();
        stateManager   = GetComponent <PlayerStateManager>();
        rb2d           = GetComponent <Rigidbody2D>();
        if (playerMovement != null && stateManager != null)
        {
            stateManager.CallOnStateEnter(
                State.Posession, playerMovement.FreezePlayer);
            stateManager.CallOnStateExit(
                State.Posession, playerMovement.UnFreezePlayer);
            PlayerMovement actualPlayerMovement = playerMovement as PlayerMovement;
            if (actualPlayerMovement != null)
            {
                ballTurnSpeed = actualPlayerMovement.rotationSpeed / 250;
            }
        }
        laserGuide = this.GetComponent <LaserGuide>();
        this.FrameDelayCall(() => { GetGoal(); GetTeammate(); }, 2);

        NotificationManager notificationManager = GameManager.instance.notificationManager;

        notificationManager.CallOnMessage(Message.GoalScored, HandleGoalScored);
    }
Beispiel #2
0
    public void Load()
    {
        //guides[countGuide].Load(firePos);
        LaserManager lm = GameManager.Instance.laserManager;

        guide = lm.GetGuide();
        guide.Load(firePos);
    }
Beispiel #3
0
    private void Start()
    {
        player         = this.EnsureComponent <Player>();
        playerMovement = this.EnsureComponent <PlayerMovement>();
        stateManager   = this.EnsureComponent <PlayerStateManager>();
        Ball           = FindObjectOfType <Ball>().ThrowIfNull("Could not find ball");
        photonView     = this.EnsureComponent <PhotonView>();
        if (playerMovement != null && stateManager != null)
        {
            PlayerMovement actualPlayerMovement = playerMovement as PlayerMovement;
            if (actualPlayerMovement != null)
            {
                ballTurnSpeed = actualPlayerMovement.rotationSpeed / 250;
            }
        }
        laserGuide = this.GetComponent <LaserGuide>();

        NotificationManager notificationManager = GameManager.NotificationManager;

        notificationManager.CallOnMessage(Message.GoalScored, HandleGoalScored);
        stateManager.OnStateChange += HandleNewPlayerState;
        CalculateOffset();
    }