コード例 #1
0
    private void OnEnable()
    {
        tutorialText = GetComponent <TextMeshProUGUI>();

        moveVector   += GunsMesh.GetRandomDirection();
        disappearTime = disappearTimeOrigin;
    }
コード例 #2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     isCollided = false;
     EventManager.Instance.UpdateEvent("WayOutEvent_DenyPlayerExitText",
                                       new TextEventInfo {
         text       = warningText,
         position   = collision.transform.position + GunsMesh.GetRandomDirection(),
         isCollided = isCollided,
     });
 }
コード例 #3
0
    private void OnPlayerIsDead(object data)
    {
        gameObject.SetActive(true);
        isCollided         = true;
        transform.position = GameManager.instance.playerTransform.position + GunsMesh.GetRandomDirection(0);
        tutorialText.SetText("Oh no! Thats terrible! The game will auto restart to help you out!");
        tutorialText.color = Color.yellow;
        textState          = TextState.EnableScreen;

        Invoke("IsCollidedFalse", 3f);
    }
コード例 #4
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     isCollided = false;
     if (collision.CompareTag("Player"))
     {
         EventManager.Instance.UpdateEvent("CollidedEvent_ExitEvent",
                                           new TextEventInfo {
             text       = eventText,
             position   = GameManager.instance.playerTransform.position + GunsMesh.GetRandomDirection(),
             isCollided = isCollided,
         });
     }
 }
コード例 #5
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     isCollided = true;
     if (collision.CompareTag("Player") &&
         GameManager.instance.GemsCount >= 6)
     {
         EventManager.Instance.UpdateEvent("HeroController_WayOutEvent_EndLevel",
                                           new PopupEventInfo {
             title      = "Congratulation",
             content    = " \n You have done well! Would you like to go back to the main menu?",
             okCallback = () => { SceneManager.LoadScene(0); }
         });
     }
     else if (collision.CompareTag("Player") &&
              GameManager.instance.GemsCount < 6)
     {
         EventManager.Instance.UpdateEvent("WayOutEvent_DenyPlayerEnterText",
                                           new TextEventInfo {
             text       = warningText,
             position   = collision.transform.position + GunsMesh.GetRandomDirection(),
             isCollided = isCollided,
         });
     }
 }
コード例 #6
0
    private void ReActivePowerUp()
    {
        Transform heal = GetPooled(init.data.powerUpPooledList);

        if (heal)
        {
            heal.GetComponent <PowerUpMesh>().ReActivate();
            heal.position = GetRandomPosition(init.data.tempPowerUpPosList, init.data.originPowerUpPosList) + GunsMesh.GetRandomDirection(0);
        }
    }