void Start()
    {
        b_IsInPuMode       = false;
        SC_ScoreCounterRef = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();
        v_startSize        = transform.localScale;
        v_startPos         = transform.position;

        SC_PlayerRef = player.GetComponent <SC_Player>();

        this.guiText.color = SC_PlayerRef.s_Color;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        Time.timeScale = 1f;
        g_scoreDisplayROOT.SetActive(false);

        SC_ScoreCouterRef = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();


        a_Players = GameObject.FindGameObjectsWithTag("Player");



        a_highScores = PlayerPrefsX.GetIntArray("high scores" + a_Players.Length.ToString());

        foreach (int scores in a_highScores)
        {
            l_highScores.Add(scores);
        }

        if (l_highScores.Count < 5)
        {
            while (l_highScores.Count < 5)
            {
                l_highScores.Add(1000);
            }
        }

        l_highScores.Sort();

        while (l_highScores.Count > 5)
        {
            l_highScores.RemoveAt(0);
        }


        if (b_resetScore)
        {
            for (int i = 0; i < 5; i++)
            {
                l_highScores[i] = 1000;
            }
        }

//		a_highScores = l_highScores.ToArray();
//		PlayerPrefsX.SetIntArray("high scores", a_highScores);
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent<SC_SoundManager>();

        SC_PlayerRef = this.GetComponent<SC_Player>();
        SC_playerComboCounterRef = SC_PlayerRef.SC_playerComboCounterRef;

        SC_ScoreCounterRef = GameObject.Find("guiSCOREcounter").GetComponent<SC_ScoreCounter>();
        SC_PlayerRef = GetComponent<SC_Player>();
        SC_PlayerComboRef = GetComponent<SC_playerCombo>();

        //POUR LE DASHFIRE
        SC_dashTrailRef = GetComponent<SC_dashTrail>();
        f_initialDashFade = SC_PlayerRef.f_TrailfadeOutSpeed;
        f_initialTrailSpeed = SC_dashTrailRef.f_TrailSpeed;
    }
示例#4
0
    void Start()
    {
        _PlayerIndex     = (PlayerIndex)(int)playerIndex - 1;
        _ControllerState = GamePad.GetState(_PlayerIndex);

        _PlayerAnims     = GetComponent <Animator>();
        s_PlayerState    = "Idle";
        s_CurrentAnim    = "idle_1";
        i_LookingDir     = 1;
        i_CurrentLookDir = 1;
        f_AttackTime     = 0;
        b_IsInPuMode     = false;

        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        SC_mainLightRef          = GameObject.Find("flashLight_root").GetComponent <SC_mainLight>();
        SC_ScoreCounterRef       = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();
        _TriggerCaC              = this.transform.FindChild("TriggerCac").gameObject;
        SC_playerComboCounterRef = GameObject.Find("scoreCounterGUI" + (int)playerIndex).GetComponent <SC_playerComboCounter>();
        SC_playerComboRef        = this.GetComponent <SC_playerCombo>();
        SC_playerDeathRef        = this.GetComponent <SC_playerDeath>();
        SC_closeToEnnemiFBRef    = this.GetComponent <SC_closeToEnnemiFB>();
        SC_dashTrailRef          = GetComponent <SC_dashTrail>();

        _Viseur = GameObject.Find("Viseur" + (int)playerIndex).gameObject;
        _Viseur.renderer.material.color = s_Color;

        b_HasTouchedForDash = false;

        b_DashKill = false;

        Physics.IgnoreLayerCollision(8, 8);

        this.tag = "Player";

        b_IsCaCing  = false;
        b_IsDashing = false;
        b_CanDash   = true;
        CaCOFF();

        p_PUmode.startColor = s_brightColor;

        _TriggerCaCChild.SetActive(false);

        stopRumble();
    }
示例#5
0
    void Start()
    {
        //_Player = this.gameObject;

        SC_BatimentChoiceRef = this.GetComponent <SC_BatimentChoice>();
        l_LifeLamp           = transform.Find("LifeLamp").light;
        f_LifeAmountMax      = f_LifeAmount;
        f_LifeLampMax        = l_LifeLamp.spotAngle;
        //v_StartPos = transform.position;
        v_respawnPoint = GameObject.FindGameObjectWithTag("respawnPoint").transform.position;
        v_respawnPoint = new Vector3(v_respawnPoint.x, v_respawnPoint.y, transform.position.z);

        //SC_playerComboCounterRef = this.GetComponent<SC_playerComboCounter>();
        SC_ScoreCounterRef = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();
        SC_PlayerRef       = this.GetComponent <SC_Player>();
        SC_mainLightRef    = GameObject.Find("flashLight_root").GetComponent <SC_mainLight>();

        _deathColor = SC_PlayerRef.s_Color;
    }
示例#6
0
    // Use this for initialization
    void Start()
    {
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        this.tag      = "BATIMENT_MANAGER";
        a_Players     = new GameObject[GameObject.FindGameObjectsWithTag("Player").Length];
        _ScoreCounter = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();


        for (int i = 0; i < a_Players.Length; i++)
        {
            for (int j = 0; j < a_Players.Length; j++)
            {
                if ((int)GameObject.FindGameObjectsWithTag("Player")[j].GetComponent <SC_Player>().playerIndex == i + 1)
                {
                    a_Players[i] = GameObject.FindGameObjectsWithTag("Player")[j];
                }
            }
        }

        a_BatimentPlaced = new List <GameObject>();
    }
示例#7
0
    void Start()
    {
        g_walls = GameObject.FindGameObjectsWithTag("Wall");

        _AudioSource_Ennemi = gameObject.AddComponent <AudioSource>();
        _Sounds             = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();



        _deathMarkRoot = GameObject.Find("[deathMarkRoot]").gameObject;
        _EnemyAnim     = GetComponent <Animator>();

        SC_DamageRef        = this.GetComponent <SC_Damage>();
        SC_EnemyBehaviorRef = this.GetComponent <SC_EnemyBehavior>();
        SC_ScoreCounterRef  = GameObject.Find("guiSCOREcounter").GetComponent <SC_ScoreCounter>();
        this.tag            = null;

        s_EnemyState = "Walk";
//		AnimationHandeler("Walk");

        f_PushDuration = 0;

        transform.FindChild("corps").GetComponent <SpriteRenderer>().color = this.GetComponent <SpriteRenderer>().color;
    }
示例#8
0
    // Use this for initialization

    void Awake()
    {
        SC_ScoreCounterRef = GameObject.Find("guiSCOREcounter").GetComponent <SC_ScoreCounter>();
        g_parentRoot       = this.transform.parent.gameObject;
    }
示例#9
0
 // Use this for initialization
 void Start()
 {
     SC_ScoreCounterRef        = GameObject.Find("guiSCOREcounter").GetComponent <SC_ScoreCounter>();
     p_starParticle            = this.transform.GetChild(0).particleSystem;
     p_starParticle.startColor = this.renderer.material.color;
 }