Exemple #1
0
 public void Reset()
 {
     SetActive(false);
     buttonPanel.transform.localScale = scaleIn;
     EffectControl.FadeOutCanvasNow(tap);
     EffectControl.FadeOutCanvasNow(bestText.gameObject);
 }
    IEnumerator AnimGameOver()
    {
        MainCanvas.Main.inGameScript.MoveScoreDown();
        yield return(new WaitForSeconds(0.5f));

        int score = MainCanvas.Main.inGameScript.scoreInt;

        if (score > Settings.GetBest)
        {
            Settings.SetBest(score);
        }

        SetBestScore(Settings.GetBest);

        MainObjControl.Instant.camCrt.allow = false;
        StartCoroutine(EffectControl.FadeInCanvas(bestText.gameObject, 0.5f));
        yield return(new WaitForSeconds(0.2f));

        StartCoroutine(EffectControl.FadeInCanvas(tap, 0.5f));
        StartCoroutine(EffectControl.ScaleInCanvas(buttonPanel, 0.4f));
        yield return(new WaitForSeconds(0.4f));

        MainState.SetState(MainState.State.GameOver);
        //        MainAudio.Main.PlaySound(TypeAudio.SoundLose);
    }
Exemple #3
0
 /// <summary>
 /// Raises the destroy event.
 /// </summary>
 void OnDestroy()
 {
     // If scene is in progress
     if (isQuitting == false)
     {
         // Find all colliders in specified radius
         Collider2D[] cols = Physics2D.OverlapCircleAll(transform.position, radius);
         foreach (Collider2D col in cols)
         {
             if (IsTagAllowed(col.tag) == true)
             {
                 EffectControl effectControl = col.gameObject.GetComponent <EffectControl>();
                 if (effectControl != null)
                 {
                     effectControl.AddEffect(effectName, modifier, duration, effectFx);
                 }
             }
         }
         if (explosionFx != null)
         {
             // Create explosion visual effect
             Destroy(Instantiate <GameObject>(explosionFx, transform.position, transform.rotation), explosionFxDuration);
         }
         if (sfx != null && AudioManager.instance != null)
         {
             // Play sfx
             AudioManager.instance.PlaySound(sfx);
         }
     }
 }
Exemple #4
0
 void Start()
 {
     HP      = init_hp;
     is_dead = false;
     ani     = GetComponent <Animator>();
     dc      = GameObject.Find("DamageShower").GetComponent <DamageController>();
     ec      = GameObject.Find("DamageShower").GetComponent <EffectControl>();
 }
    public void AddNewPoint(bool isUp)
    {
        Vector3 newPath;

        switch (Turn)
        {
        case turn.forward:
            newPath = new Vector3(0, 0, GameDefine.roadRandSize);
            break;

        case turn.left:
            newPath = new Vector3(-GameDefine.roadRandSize, 0, 0);
            break;

        default:
            newPath = new Vector3(GameDefine.roadRandSize, 0, 0);
            break;
        }


        listPointActive.Add(listPointActive[listPointActive.Count - 1] + newPath);
        listType.Add(Random.value > 0.5f);
        Vector3 p1 = listPointActive[listPointActive.Count - 3];
        Vector3 p2 = listPointActive[listPointActive.Count - 2];
        Vector3 p3 = listPointActive[listPointActive.Count - 1];

        if (listRoadActive.Count > 2)
        {
            Vector3 pos = listRoadActive[listRoadActive.Count - 1].transform.position;
            StartCoroutine(EffectControl.Move(listRoadActive[listRoadActive.Count - 1], new Vector3(pos.x, 0, pos.z), 0.4f, null));

            pos = listBonusActive[listBonusActive.Count - 1].transform.position;
            StartCoroutine(EffectControl.Move(listBonusActive[listBonusActive.Count - 1], new Vector3(pos.x, 0, pos.z), 0.4f, null));

            pos = listBlock[listBlock.Count - 1].transform.position;
            StartCoroutine(EffectControl.Move(listBlock[listBlock.Count - 1].gameObject, new Vector3(pos.x, 2.4f, pos.z), 0.6f, null));

            pos = listBlockBonus[listBlockBonus.Count - 1].transform.position;
            StartCoroutine(EffectControl.Move(listBlockBonus[listBlockBonus.Count - 1].gameObject, new Vector3(pos.x, 2.4f, pos.z), 0.6f, null));

            MainObjControl.Instant.arrowCrt.MoveUpArrow();
        }

        CreatePath(p2, p3, listType[listType.Count - 2], isUp);
        CreateRoadBounus(p1, p2, p3, !listType[listType.Count - 2], isUp);

        RandTurn();
    }
Exemple #6
0
    public static EffectControl     get()
    {
        if (EffectControl.instance == null)
        {
            GameObject go = GameObject.Find("EffectControl");

            if (go != null)
            {
                EffectControl.instance = go.GetComponent <EffectControl>();
            }
            else
            {
                Debug.LogError("Can't find game object \"EffectControl\".");
            }
        }

        return(EffectControl.instance);
    }
Exemple #7
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);

            particles = new ParticleSystem[effectObjects.Count];
            for (int i = 0; i < particles.Length; i++)
            {
                particles[i] = Instantiate(effectObjects[i], gameObject.transform);
                particles[i].Stop();
            }
        }
        else
        {
            Destroy(gameObject);
        }
    }
Exemple #8
0
    // ================================================================ //
    // 继承于MonoBehaviour

    void    Start()
    {
        this.room_control   = RoomControl.get();
        this.scene_control  = SceneControl.get();
        this.effect_control = EffectControl.get();

        //

        this.is_grounded = false;

        GetComponent <AudioSource>().clip = START_SOUND;
        GetComponent <AudioSource>().Play();

        this.previous_velocity = Vector3.zero;

        this.next_step = STEP.STAND;

        this.coli_result      = new NekoColiResult();
        this.coli_result.neko = this;
        this.coli_result.create();

        this.action_stand.is_fade_anim = true;
    }
Exemple #9
0
    //// エフェクトの座標指定生成メソッド ////
    public void CreateEffect(string fileName, Vector3 transform, bool loop = false)
    {
        if (effectLoadList.ContainsKey(fileName))
        {
            // エフェクトのインスタンスを作成
            GameObject effectObject = Instantiate(effectLoadList[fileName], transform, Quaternion.identity);

            // EffectManager管理で作成
            effectObject.transform.SetParent(instanceTransform, false);

            // ループ指定の場合エフェクトは削除しない
            if (loop)
            {
                return;
            }

            // ループしない場合、デュレーションの時間が経過したら自動的に削除
            EffectControl effectControl = effectObject.GetComponent <EffectControl>();

            // エフェクトがループエフェクトか調べる
            if (effectControl.GetLoopFlag())
            {
                debugManager.SetDebugLog("「" + fileName + "」のエフェクトはループエフェクトの為削除できません");
                return;
            }

            // エフェクトの再生時間を超えたら自動的に削除
            Destroy(effectObject, effectControl.GetDuration());
        }
        // エフェクトがリストに存在しない時
        else
        {
            debugManager.SetDebugLog("「" + fileName + "」のエフェクトを作成出来ません");
        }

        return;
    }
Exemple #10
0
 private void ShowInflightEffect(EffectControl effectControl) {
     //D.Log("{0}.ShowInflightEffect({1}) called.", Name, effectControl.GetName());
     switch (effectControl) {
         case EffectControl.Show:
             inFlightEffect.Play();
             break;
         case EffectControl.Hide:
             if (inFlightEffect.IsAlive()) {
                 inFlightEffect.Stop();
                 inFlightEffect.Clear();
             }
             break;
         case EffectControl.Pause:
             if (inFlightEffect.isPlaying && !inFlightEffect.isPaused) {
                 inFlightEffect.Pause();
             }
             break;
         case EffectControl.Resume:
             if (inFlightEffect.isPaused) {
                 inFlightEffect.Play();
             }
             break;
         case EffectControl.None:
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(effectControl));
     }
 }
Exemple #11
0
 /// <summary>
 /// Start this instance.
 /// </summary>
 void Start()
 {
     effectControl = GetComponentInParent <EffectControl>();
     Debug.Assert(effectControl, "Wrong initial settings");
 }