コード例 #1
0
    void Start()
    {
        i_Score = 0;

        transform.tag = "scoreCounter";

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


        a_Players = GameObject.FindGameObjectsWithTag("Player");
        for (int i = 0; i < a_Players.Length; i++)
        {
            if (a_Players[i].name == "Player1")
            {
                c_player1color = a_Players[i].GetComponent <SC_Player>().s_brightColor;
            }
            if (a_Players[i].name == "Player2")
            {
                c_player2color = a_Players[i].GetComponent <SC_Player>().s_brightColor;
            }
            if (a_Players[i].name == "Player3")
            {
                c_player3color = a_Players[i].GetComponent <SC_Player>().s_brightColor;
            }
            if (a_Players[i].name == "Player4")
            {
                c_player4color = a_Players[i].GetComponent <SC_Player>().s_brightColor;
            }
        }


        g_lvlIndicator.pixelOffset = new Vector2(Screen.width / 2 - 200 / 1.3f, Screen.height - Screen.height / 20);

        calulateNexLVL();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
//		c_inNormalState = renderer.material.color;

//		c_inRocheState = renderer.material.color;
//		c_inRocheState.a = 0.25f;

        _AudioSource_Roche = gameObject.AddComponent <AudioSource>();
        _Sounds            = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        _AudioSource_Spawn = gameObject.AddComponent <AudioSource>();
        _Sounds            = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        v_StartSize   = this.transform.localScale;
        c_startColor  = gameObject.GetComponent <SpriteRenderer>().color;
        a_Projectiles = new List <GameObject>();
        f_StartTime   = Time.time;
        g_corps       = this.transform.FindChild("corps").gameObject;
    }
コード例 #4
0
ファイル: SC_Resurrect.cs プロジェクト: DamiFa/TanukiNoTama
    // Use this for initialization
    void Start()
    {
        _AudioSource_Resurrect = gameObject.AddComponent <AudioSource>();
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        p_particleResurect1 = Instantiate(p_particleResurect, transform.position, Quaternion.identity) as ParticleSystem;
        p_particleResurect2 = Instantiate(p_particleResurect, transform.position, Quaternion.identity) as ParticleSystem;


        SC_particleDirection1 = p_particleResurect1.GetComponent <SC_particleDirection>();
        SC_particleDirection2 = p_particleResurect2.GetComponent <SC_particleDirection>();

        i_StateToBe = 6;

        _Line = GetComponent <LineRenderer>();

        a_Parts = new GameObject[2];

        b_InResurrection     = false;
        b_StartedResurrected = false;

        float _signe;

        for (int i = 0; i < 2; i++)
        {
            if (i % 2 == 0)
            {
                _signe = 1;
            }
            else
            {
                _signe = -1;
            }

            GameObject temp = Instantiate(_EnemyResurrect, new Vector3(transform.position.x + f_DistanceOfParts * 0.5f * _signe,
                                                                       transform.position.y,
                                                                       transform.position.z), Quaternion.identity) as GameObject;
            temp.transform.parent = this.transform;

            a_Parts[i] = temp;

            a_Parts[i].GetComponent <SC_EnemyBehavior>().i_State = i_StateToBe;
        }

        SC_particleDirection1.t_destination = a_Parts[1].transform;
        SC_particleDirection2.t_destination = a_Parts[0].transform;

        //p_particleResurect1.startSize = a_Parts[0].transform.localScale.x/2;
        //p_particleResurect2.startSize = a_Parts[1].transform.localScale.x/2;

        //p_particleResurect1.transform.parent = a_Parts[0].transform;
        //p_particleResurect2.transform.parent = a_Parts[1].transform;
    }
コード例 #5
0
ファイル: SC_GameManager.cs プロジェクト: DamiFa/TanukiNoTama
    // 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);
    }
コード例 #6
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;
    }
コード例 #7
0
ファイル: SC_Player.cs プロジェクト: DamiFa/TanukiNoTama
    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();
    }
コード例 #8
0
ファイル: SC_batimentVie.cs プロジェクト: DamiFa/TanukiNoTama
    // Use this for initialization
    void Start()
    {
        _AudioSource_bat = gameObject.AddComponent <AudioSource>();
        _Sounds          = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        g_backgroundColor       = this.transform.FindChild("bat_Background").gameObject;
        p_damageParticle        = this.transform.FindChild("damageParticle").particleSystem;
        SC_PlayerRef            = _Player.GetComponent <SC_Player>();
        renderer.material.color = SC_PlayerRef.s_brightColor;
        g_CrestRoot             = this.gameObject;
        f_StartSize             = transform.localScale.x;
        f_LifeAmountMax         = f_LifeAmount;
        c_crestColor            = renderer.material.color;

        p_damageParticle.startColor = c_crestColor;
        g_backgroundColor.renderer.material.color = SC_PlayerRef.s_brightColor;
        g_backgroundColor.SetActive(false);

        v_startSize = transform.localScale;
    }
コード例 #9
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>();
    }
コード例 #10
0
    // Use this for initialization
    private void Start()
    {
        b_SoundRunAway       = true;
        _AudioSource_RunAway = gameObject.AddComponent <AudioSource>();
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();


        a_Players    = GameObject.FindGameObjectsWithTag("Player");
        a_Batiments  = GameObject.FindGameObjectsWithTag("batiment");
        _PathManager = GameObject.FindGameObjectWithTag("PATH_MANAGER").GetComponent <SC_PathManager>();

        a_Path = _PathManager.GetEnemyPath(s_PathName);

        i_FormationId = 0;

        i_State = (int)i_StateStart;

        b_IsOnPath = false;

        f_goodSpeed = f_Speed / iTween.PathLength(a_Path);

        f_Timer = 0;
    }
コード例 #11
0
ファイル: SC_Ennemi.cs プロジェクト: DamiFa/TanukiNoTama
    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;
    }