void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "player")
     {
         oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_POWERUP);
         Destroy(gameObject);
         GMS.ennemyChase = false;
         //startTimer
         GMS.CoolDownPowerUpStart();
     }
 }
Exemplo n.º 2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "player")
     {
         if (GMS.ennemyChase)
         {
             //ennemy kills player
             oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.ENEMY_TOUCH);
             KillPlayer();
         }
         else
         {
             //player kills ennemy
             oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_TOUCH);
             //gameObject.collider
             alive = false;
             transform.GetComponent <Renderer>().sharedMaterial             = DeadMaterial;
             transform.GetChild(0).GetComponent <Renderer>().sharedMaterial = MinimapDeadMaterial;
         }
     }
 }
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "player")
     {
         //Debug.Log("Coin collected");
         oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_COIN);
         GMS.AddCollectedCoin(gameObject);
         gameObject.SetActive(false);
         //Destroy(gameObject);
         GMS.coinsCounter--;
         //adding score...
     }
 }
Exemplo n.º 4
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "player")
        {
            if (em.isTraining)
            {
                //training mode
                em.ApplyBlackScreen();
            }
            else
            {
                //playing mode
                oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_PORTAL);
                EN.SaveAndIncrementEnemySpeed();

                SceneManager.LoadScene(levelToLoad);
            }
        }
    }
Exemplo n.º 5
0
    void Projection(bool projectMinimap)
    {
        RaycastHit hit  = new RaycastHit();
        RaycastHit hit1 = new RaycastHit();
        RaycastHit hit2 = new RaycastHit();
        RaycastHit hit3 = new RaycastHit();
        RaycastHit hit4 = new RaycastHit();

        if (Physics.Raycast(raySpots[0].position, transform.forward, out hit, Mathf.Infinity, 1 << layerMask) &&
            Physics.Raycast(raySpots[1].position, transform.forward, out hit1, Mathf.Infinity, 1 << layerMask) &&
            Physics.Raycast(raySpots[2].position, transform.forward, out hit2, Mathf.Infinity, 1 << layerMask) &&
            Physics.Raycast(raySpots[3].position, transform.forward, out hit3, Mathf.Infinity, 1 << layerMask) &&
            Physics.Raycast(raySpots[4].position, transform.forward, out hit4, Mathf.Infinity, 1 << layerMask) &&
            IsOnSameWall(hit, hit1, hit2, hit3, hit4))
        {
            if (projectMinimap)
            {
                //proejct minimap
                oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_MINIMAP);

                if (!GMS.isTraining)
                {
                    GameObject.Find("GlobalControl").GetComponent <CSVSave>().SetActivatedMinimap(true);
                }

                SetActiveMinimap(true);

                SetPlanePosition(hit, mapPlane1, mapPlane2);

                MinimapScript.UpdateMinimapPosition();
                GMS.StartMinimapCooldown();
            }
            else
            {
                SetActiveCooldown(true);
                SetPlanePosition(hit, cooldownPlane1, cooldownPlane2);
            }
        }
    }
Exemplo n.º 6
0
 protected virtual void StartTeleport(object sender, DestinationMarkerEventArgs e)
 {
     //openVibe
     oen.NotifyEvent(OpenvibeEventNotifier.EventTypes.PLAYER_TELEPORT);
     OnTeleporting(sender, e);
 }