示例#1
0
    // Use this for initialization
    void Start() {
        standingColl.enabled = true;
        crouchingColl.enabled = false;
        lastYCoord = -10000.0f;
        lastPosition = transform.position;

        audioLoader = GetComponent<AudioLoader>();
        jumpSound = audioLoader.GetSound("Jump");
        pushSound = audioLoader.GetSound("Push");
        step0Sound = audioLoader.GetSound("Step0");
        step1Sound = audioLoader.GetSound("Step1");
    }
示例#2
0
    // Use this for initialization
    new void Start () {
        //Inicializacion basica del manager
        base.Start();

        audioLoader = GetComponent<AudioLoader>();
        successSound = audioLoader.GetSound("Success");
        failSound = audioLoader.GetSound("Fail");

        //Inicializacion del mapa de estado de objetos a false
        usablesState = new Dictionary<UsableObject, bool>();
        foreach(UsableObject o in usables)
        {
            usablesState.Add(o, o.onUse);
        }
	}
示例#3
0
    /*
    public void OnEnable() {
        if(hasFadeCutScene) {
            ActivableFade.FadeInOutEvent += OpenDoorCutScene;
        }
        
    }

    public void OnDisable() {
        if(hasFadeCutScene) {
            ActivableFade.FadeInOutEvent -= OpenDoorCutScene;
        }
        
    }
    */

    // Use this for initialization
    void Start()
    {

        //Si se va a mostrar un cutscene
        cutScene = GetComponent<CutScene>();
        /*
        if (hasFadeCutScene) {
            activableFade = GetComponent<ActivableFade>();
        }
        */
        audioLoader = GetComponent<AudioLoader>();
        if(audioLoader) {
            openSound = audioLoader.GetSound("Open");
            closeSound = audioLoader.GetSound("Close");
        }


        //Se calcula un offset ( distancia a la que se movera) en funcion al tamaño y direccion de apertura
        Vector3 size = transform.localScale*4.2f;//REVISAR!!!!!!!!!!!!!!!!!!!//GetComponent<Renderer>().bounds.size;
        
        switch (openDirection)
        {
            case Direction.Down:
                offset = new Vector3(0, -size.y, 0);
                break;
            case Direction.Up:
                offset = new Vector3(0, size.y, 0);
                break;
            case Direction.Left:
                offset = new Vector3(-size.z, 0, 0);
                break;
            case Direction.Right:
                offset = new Vector3(size.z, 0, 0);
                break;

        }

        //Se guara la posicion final de la puerta cuando este abierta
        endPosition = startPosition + offset;


    }
示例#4
0
    // Use this for initialization
    void Start() {

        audioLoader = GetComponent<AudioLoader>();

        checkPointSound = audioLoader.GetSound("CheckPoint");
        if (!isActive)
        {
            vortex.Hide();
        }

    }
示例#5
0
    // Use this for initialization
    void Start() {

        audioLoader = GetComponent<AudioLoader>();

        changeCharacterSound = audioLoader.GetSound("ChangeCharacter");

        activeCheckPoint.ActivateMuted();

        activeCharacter = characterList[0];
        activeCharacter.GetComponent<CharacterStatus>().playerParticles.IntensifyColor();
        if (ActiveCharacterChangedEvent != null) {
            ActiveCharacterChangedEvent(activeCharacter);
        }
    }
示例#6
0
    // Use this for initialization
    void Start()
    {
        //Si se va a mostrar un cutscene
        cutScene = GetComponent<CutScene>();

        audioLoader = GetComponent<AudioLoader>();
        if(audioLoader) {
            activationSound = audioLoader.GetSound("Activation");
            deActivationSound = audioLoader.GetSound("Deactivation");

        }

        //Se calcula un offset ( distancia a la que se movera) en funcion al tamaño y direccion de apertura
        //Vector3 size = transform.localScale;//GetComponent<Renderer>().bounds.size;

        switch (openDirection)
        {
            case Direction.Down:
                offset = new Vector3(0, -movement, 0);
                break;
            case Direction.Up:
                offset = new Vector3(0, movement, 0);
                break;
            case Direction.Left:
                offset = new Vector3(-movement, 0, 0);
                break;
            case Direction.Right:
                offset = new Vector3(movement, 0, 0);
                break;

        }




    }
示例#7
0
    // Use this for initialization
    void Start() {

        audioLoader = GetComponent<AudioLoader>();
        messagesSfxs = new ArrayList();

        //Rellenamos el array de efectos de sonido
        messagesSfxs.Add(audioLoader.GetSound("Message1"));
        messagesSfxs.Add(audioLoader.GetSound("Message2"));
        messagesSfxs.Add(audioLoader.GetSound("Message3"));
        messagesSfxs.Add(audioLoader.GetSound("Message4"));
        messagesSfxs.Add(audioLoader.GetSound("Message5"));

        //Estado inicial
        messageState = State.NoMessage;

        messages = new ArrayList();

        //Se inicializa la velocidad a la velocidad normal
        letterSpeed = normalLetterSpeed;
        isConversation = false;
        //shownImg = null;

        //Se cargan los mensajes desde fichero
        FillMessages();

    }
示例#8
0
 // Use this for initialization
 void Start() {
     // Inicialización
     Initialization();
     //Se saca el objeto del padre para poder añadirlo como hijo a nuevos elementos
     transform.parent = null;
     // Obtención sonidos
     audioLoader = GetComponent<AudioLoader>();
     resurrectSound = audioLoader.GetSound("Resurrect");
     dieSound = audioLoader.GetSound("Die");
     sacrificeSound = audioLoader.GetSound("Sacrifice");
     pushSound = audioLoader.GetSound("Push");
 }
示例#9
0
    /// <summary>
    /// Es necesario llamar a esta funcion desde los scripts que heredan mediante base.Start
    /// </summary>
    public void Start() {

        activables = new List<IActivable>();

        //Se guarda la referencia al script Activable

        foreach (GameObject target in targets) {
            activables.Add(target.GetComponent<IActivable>());
        }

        //Si no tiene detector de uso, se asume que se puede usar desde cualquier posicion
        if (GetComponentInChildren<TooltipDetector>() == null) {
            canUse = true;
        }

        audioLoader = GetComponent<AudioLoader>();
        if (type.Equals(UsableTypes.Timed)) {
            timeSound = audioLoader.GetSound("TickTack");
            fastTimeSound = audioLoader.GetSound("FastTickTack");
        }
    }