Ejemplo n.º 1
0
    public CharicterPosition getPositionData()
    {
        CharicterPosition posData = new CharicterPosition();

        posData.pos        = transform.position;
        posData.rot        = transform.rotation;
        posData.use3D      = m_use3D;
        posData.left_right = m_left_right;

        return(posData);
    }
    // this boolean is set to true on entering the state and remains true
    // while the ghost is coliding with any interactables that it isn't standing on
    //private bool m_colidedWithInteractable = false;
    //private bool m_reduceColisions = true;

    public void Activate(CharicterPosition posData)
    {
        gameObject.tag = "Player";

        // set layer to Ghost (reduced Collisions)
        //gameObject.layer = 11;

        //m_reduceColisions = true;
        //m_colidedWithInteractable = false;

        if (m_overrideRecording)
        {
            m_overrideRecording    = false;
            m_recorded             = false;
            m_countdown.m_progress = 1.0f;
            m_data.m_pause         = false;
        }

        for (int z = 0; z < m_matirialRenderers.Length; z++)
        {
            m_matirialRenderers[z].material.color = new Color(0.1f, 1.0f, 1.0f, 0.5f);
        }

        // alows the ghost to animate again
        m_data.m_anim.SetBool("Stopped", false);

        if (m_recorded)
        {
            m_arrayPosition = 0;

            m_playing      = true;
            m_data.m_pause = false;

            StartCoroutine(Play());
        }
        else
        {
            gameObject.transform.position = posData.pos;
            gameObject.transform.rotation = posData.rot;
            //m_data.m_cameraRotation = posData.rot;
            m_data.m_cameraRotation = posData.rot.eulerAngles.y;
            m_data.SetRotation(posData.rot);
            m_data.m_left_right = posData.left_right;

            m_data.m_use3D  = posData.use3D;
            m_arrayPosition = 0;
            m_recording     = true;
        }
    }
Ejemplo n.º 3
0
    // this is insted of a start function to decide when this function is called
    public void Initialize()
    {
        m_directory          = Directory.GetCurrentDirectory();
        m_positionDirectory  = m_directory;
        m_directory         += "\\save.sav";
        m_positionDirectory += "\\posSave.sav";

        Debug.Log("File is : " + m_directory);

        m_playerData = gameObject.GetComponent <PlayerData>();

        m_savedPosData = new CharicterPosition();

        Load();
        LoadPosition();

        m_upgrades = (char)int.Parse(m_data);

        GetSavedUpgrades();

        m_soundSystem = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SoundSystem>();

        if (m_upgrades > (char)0)
        {
            m_soundSystem.NextTrack();
        }

        if (m_upgrades > (char)1)
        {
            m_soundSystem.NextTrack();
        }

        if (m_upgrades > (char)3)
        {
            m_soundSystem.NextTrack();
        }
    }