예제 #1
0
 private void OnGUI()
 {
     if (IsInDoorway)
     {
         GameObject temp = GameObject.Find("Enemy");
         if (temp == null)
         {
             if (!IsDoorLocked)
             {
                 Char_Next_Door.SetActive(true);
             }
             else
             {
                 Char_Locked_Door.SetActive(true);
             }
         }
     }
     else
     {
         Char_Next_Door.SetActive(false);
         Char_Locked_Door.SetActive(false);
     }
     Char_Health_Bar.value = Health;
     for (int i = 0; i < SFX.Length; i++)
     {
         SFX[i].volume = AudioSourceVolumeSlider.value;
     }
 }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        AimDir = new Vector2(0.0f, 0.0f);
        Char_Pause_Menu.SetActive(false);
        Char_Next_Door.SetActive(false);
        Char_Locked_Door.SetActive(false);

        CharBody = GetComponent <Rigidbody2D>();

        DoorLock    = Time.time;
        IsInDoorway = false;

        Health = 100;
        Char_Health_Bar.maxValue = Health;

        AttackCooldown = Time.time;

        GameObject PlayerAoE = new GameObject("PlayerAoE");

        PlayerAoE.transform.SetParent(gameObject.transform);
        PlayerAoE.AddComponent <CircleCollider2D>();
        HurtCircle           = PlayerAoE.GetComponent <CircleCollider2D>();
        HurtCircle.radius    = 1.0f;
        HurtCircle.offset    = new Vector2(0.0f, -0.1f);
        HurtCircle.isTrigger = true;
        PlayerAoE.tag        = "AoE_Damage";
        HurtCircle.enabled   = false;

        Char_Animator = GetComponent <Animator>();
        //SFX = GetComponent<AudioSource>();
        for (int i = 0; i < SFX.Length; i++)
        {
            SFX[i].mute = true;
        }
        AudioSourceVolumeSlider.minValue = 0.0f;
        AudioSourceVolumeSlider.maxValue = 1.0f;
    }