Exemple #1
0
 protected override void Awake()
 {
     shakeManager = GetComponent <ShakeManager>();
     theQm        = FindObjectOfType <QuestManager>();
     theMc        = FindObjectOfType <MusicController>();
     base.Awake();
 }
 void Awake()
 {
     mainCamera = Camera.main;
     if (s_Instance == null)
         s_Instance = this;
     //DontDestroyOnLoad(this);
 }
 private void Update()
 {
     if (Input.GetKey(KeyCode.Space) && Time.time - shakeTime > 0.3f)
     {
         shakeTime = Time.time;
         ShakeManager.AddShake(Delay, Strength, CycleTime, Duration);
     }
 }
 void Awake()
 {
     hp             = maxhp;
     gunNum         = guns.Length;
     cooldown       = maxCooldown;
     gameManager    = GameObject.Find("GameManager");
     mainController = gameManager.GetComponent <MainController>();
     shake          = GameObject.Find("CameraShakeManager").GetComponent <ShakeManager>();
 }
    void Start()
    {
        instance = this;

        if (currentKShake == "" && shakes.Count > 0)
        {
            currentKShake = shakes[0].name;
        }
    }
Exemple #6
0
 void Awake()
 {
     mainCamera = Camera.main;
     if (s_Instance == null)
     {
         s_Instance = this;
     }
     //DontDestroyOnLoad(this);
 }
Exemple #7
0
    // Update is called once per frame
    void Update()
    {
        if (isTouch)
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            Vector3    aTapPoint   = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            Collider2D aCollider2d = Physics2D.OverlapPoint(aTapPoint);

            if (aCollider2d)
            {
                GameObject obj = aCollider2d.transform.gameObject;
                Debug.Log(obj.name);

                if (obj.name == gameObject.name)
                {
                    isTouch = true;
                    StartCoroutine(ShakeManager.RunAnime(gameObject.transform, 3, 0.1f, 0.5f, delegate
                    {
                        hukidashi.enabled = true;
                        serihu.enabled    = true;

                        string serihus = "Bon journee";

                        switch (Random.Range(0, 4))
                        {
                        case 0:
                            serihus = "トレビア~ン\n何かいいことが\nありそうですね";
                            break;

                        case 1:
                            serihus = "たまにはゆっくり\n歩いてみるのも\nいいですね";
                            break;

                        case 2:
                            serihus = "今日は何やら催しが\nお得があるかも\nしれませんね";
                            break;

                        case 3:
                            serihus = "Bon journee";
                            break;
                        }
                        serihuText.text = serihus;

                        Invoke("removeHukidshi", 5.0f);
                    })
                                   );
                }
            }
        }
    }
    void Awake()
    {
        GameObject gameManager = GameObject.Find("GameManager");

        mainController = gameManager.GetComponent <MainController>();
        shake          = GameObject.Find("CameraShakeManager").GetComponent <ShakeManager>();

        maxhp = mainController.hp;
        hp    = mainController.hp;

        maxWait = Random.Range(1, 5);
    }
Exemple #9
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }
Exemple #10
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Enemy"))
     {
         if (!damaged)
         {
             damaged = true;
             health.Damage(10f);
             ShakeManager.Shake(ShakeManager.HugeIntensity, 0.5f);
         }
     }
 }
Exemple #11
0
 public void HitShield()
 {
     AudioCenter.Instance.PlaySound("ShieldHit");
     ShakeManager.ShakeAfterShieldHit();
     countShield--;
     if (countShield <= 0f)
     {
         DestroyShield();
     }
     else
     {
         shieldHitAnim.Play("ShieldHit");
     }
 }
            void Awake()
            {
                I = this;

                if (CameraTarget == null)
                {
                    CameraTarget = Camera.main;
                }

                if (ShakeClock == null)
                {
                    ShakeClock = GetComponent <Clock>();
                }

                ShakeClock.SetClockTarget(this);
            }
Exemple #13
0
    private void OnCollisionEnter(Collision collision)
    {
        GameObject obj = collision.gameObject;

        if (obj.CompareTag("Bullet"))
        {
            Vector3 knockbackdelta = -moveDirection * knockback;
            transform.Translate(knockbackdelta);
            ObjectPool bulPool = ObjectPoolManager.Instance.GetPool(obj.tag);
            if (bulPool != null)
            {
                bulPool.Destroy(obj);
            }
            flash = true;

            ShakeManager.Shake(ShakeManager.SmallIntensity, 0.2f);
        }
    }
Exemple #14
0
 public void DestroyPlayer(bool isMario)
 {
     alive             = false;
     GameState.isAlive = false;
     if (!GameState.isLearning)
     {
         GameManager.Instance.Kill();
     }
     else
     {
         InGameGUI.Instance.DieInLearning(isMario);
     }
     powerUp.DeactivateAll();
     Instantiate(destroyedVersion.gameObject, _RBTransform.position, _RBTransform.rotation, transform.parent).GetComponent <ParticleSystem>().Play();
     AudioCenter.Instance.PlaySound("DestroyPlayer");
     ShakeManager.ShakeAfterDeath();
     StopCoroutine("ControllSpeed");
     gameObject.SetActive(false);
 }
Exemple #15
0
 protected override void Awake()
 {
     shakeManager = GetComponent <ShakeManager>();
     base.Awake();
 }