Пример #1
0
 void Start()
 {
     lights     = GetComponent <UnityEngine.Experimental.Rendering.Universal.Light2D>();
     sprite     = GetComponent <SpriteRenderer>();
     sound      = GetComponent <AudioSource>();
     LifeSystem = FindObjectOfType <LiveCounterScript>();
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        // Make the game run as fast as possible
        Application.targetFrameRate = 60;
        //Load data
        if (SaveSystem.FileExits())
        {
            PlayerData data = SaveSystem.LoadRubies();
            if (data.Dashcooldown != 0)
            {
                dashcooldown = data.Dashcooldown;
            }
        }
        GameOver    = false;
        respawnonce = false;
        // Make the game run as fast as possible
        Application.targetFrameRate = 60;
        //camerasettings
        vcam  = GameObject.Find("CM vcam1").GetComponent <CinemachineVirtualCamera>();
        noise = vcam.GetCinemachineComponent <CinemachineBasicMultiChannelPerlin>();


        //player settings
        healthAmount      = 100;
        IsDead            = false;
        localScale        = transform.localScale;
        rb                = GetComponent <Rigidbody2D>();
        anim              = GetComponent <Animator>();
        LifeSystem        = FindObjectOfType <LiveCounterScript>();
        KunaiSystem       = FindObjectOfType <KunaiCounterScript>();
        KunaiSystem.Kunai = 10;
        KunaiFinished     = false;
        sounds            = GetComponents <AudioSource>();
        material          = GetComponent <SpriteRenderer>().material;

        StepSound   = sounds[0];
        AttackSound = sounds[1];
        LandSound   = sounds[2];
        JumpSound   = sounds[3];
        DashSound   = sounds[4];
        ThrowSound  = sounds[5];
        DeathMusic  = sounds[6];
        DeathSound  = sounds[7];
        //StepSound.Play();

        localScale = transform.localScale;
    }