Ejemplo n.º 1
0
    void ActivateMonster()
    {
        //1 == A
        //2 == B
        //3 == C
        //4 == D
        switch (_region)
        {
        case 1:
        {
            faceTransform.SetPositionX(_spawnZones[_region].GetRandomPosition().X);
            faceTransform.SetPositionZ(_spawnZones[_region].GetRandomPosition().Z);
            faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL));
            faceRender.setEnabled(true);
            break;
        }

        case 2:
        {
            faceTransform.SetPositionX(_spawnZones[_region].GetRandomPosition().X);
            faceTransform.SetPositionZ(_spawnZones[_region].GetRandomPosition().Z);
            faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL));
            faceRender.setEnabled(true);
            break;
        }

        case 3:
        {
            faceTransform.SetPositionX(_spawnZones[_region].GetRandomPosition().X);
            faceTransform.SetPositionZ(_spawnZones[_region].GetRandomPosition().Z);
            faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL));
            faceRender.setEnabled(true);
            break;
        }

        case 4:
        {
            faceTransform.SetPositionX(_spawnZones[_region].GetRandomPosition().X);
            faceTransform.SetPositionZ(_spawnZones[_region].GetRandomPosition().Z);
            faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL));
            faceRender.setEnabled(true);
            break;
        }

        default:
        {
            //faceTransform.SetPosition(_spawnZones[_region]);
            break;
        }
        }
    }
    public void TriggerMonster(Vector3 spawn)
    {
        faceTransform.SetPositionX(spawn.X);
        faceTransform.SetPositionZ(spawn.Z);
        //faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL));
        faceRender.setEnabled(true);

        alive = true;

        currAliveTimer = MMath.GetRandomLimitedFloat(_monsterMinActiveTime, _monsterMaxActiveTime);

        sound.PlayIndependentEvent("C1_LAUGH", false, 1);
    }