Esempio n. 1
0
 public void RegisterPlayer(PlayerTutorial player)
 {
     if (players.Contains(player))
     {
         return;
     }
     players.Add(player);
     UpdateText();
 }
Esempio n. 2
0
    public void RegisterReadyPlayer(PlayerTutorial player)
    {
        if (readyPlayers.Contains(player))
        {
            return;
        }
        readyPlayers.Add(player);
        UpdateText();

        if ((numPlayersReady == numPlayers) && (numPlayers > 0))
        {
            StartCoroutine(StartGameText());
        }
    }
Esempio n. 3
0
    public void DeregisterPlayer(PlayerTutorial player)
    {
        if (!readyPlayers.Contains(player))
        {
            return;
        }
        Debug.Log("Deregistering player!");
        readyPlayers.Remove(player);
        UpdateText();

        if ((numPlayersReady == numPlayers) && (numPlayers > 0))
        {
            StartCoroutine(StartGameText());
        }
    }
 void Slam()
 {
     body.velocity = new Vector2(0, -jumpSpeed * 1.5f);
     Instantiate(slamParticles, transform);
     Collider2D[] results = new Collider2D[8];
     results = Physics2D.OverlapBoxAll(transform.position, slamSize, 0);
     foreach (Collider2D col in results)
     {
         if (col != null)
         {
             PlayerTutorial c = col.gameObject.GetComponent <PlayerTutorial>();
             if (c != null)
             {
                 c.TakeKnockback(transform.position, slamKnockback);
                 c.TakeDamage(0);
             }
         }
     }
     sound.PlaySlam();
 }
    private IEnumerator Clips()
    {
        runningLiveClips = true;
        StartListeningForPlayers();
        GameManager.NotificationManager.CallOnMessage(Message.RecordingFinished,
                                                      () =>
        {
            if (!clipReloadThisFrame)
            {
                ClipReload();
                clipReloadThisFrame = true;
                this.FrameDelayCall(() => clipReloadThisFrame = false, 3);
            }
        });
        GameManager.NotificationManager.CallOnMessage(Message.RecordingInterrupt,
                                                      SubclipInterrupt);
        yield return(null);

        ySkip.StartListening();
        foreach (LiveClipInfo liveClip in liveClips)
        {
            clipReloadThisFrame = false;
            currentClip         = liveClip;
            ResetCheckin();
            currentClipName = liveClip.clipName;
            currentSubclips = liveClip.subclipInfo;
            yield return(new WaitForSecondsRealtime(liveClip.preDelay));

            LoadLiveClip(currentClipName);
            yield return(null);

            while (!AllCheckedIn() && !ySkip.AllCheckedIn())
            {
                yield return(null);
            }
            yield return(null);

            TransitionUtility.OneShotFadeTransition(0.3f, 0.2f);
            yield return(new WaitForSecondsRealtime(0.15f));

            UnloadCurrentClip();
            yield return(null);

            if (ySkip.AllCheckedIn())
            {
                break;
            }
        }
        TransitionUtility.OneShotFadeTransition(0.1f, 0.4f);
        yield return(new WaitForSeconds(0.05f));

        runningLiveClips = false;
        if (ySkip.AllCheckedIn())
        {
            PlayerTutorial.SkipTutorial();
        }
        else
        {
            SceneStateManager.instance.Load(Scene.Sandbox);
        }
    }
Esempio n. 6
0
 void Start()
 {
     attackCollider = GetComponent <Collider2D>();
     parent         = GetComponentInParent <PlayerTutorial>();
 }
Esempio n. 7
0
 void Start()
 {
     playerT = player.GetComponent<PlayerTutorial>();
     playerT.enabled = true;
 }