Inheritance: MonoBehaviour
 protected static void InizializeGameObjects()
 {
     CallFinished = false;
     player       = GameObject.FindGameObjectWithTag("Player");
     rb2dPlayer   = player.GetComponent <Rigidbody2D>();
     fadeOut      = GameObject.FindGameObjectWithTag("UI").GetComponentInChildren <FadeOut>();
 }
示例#2
0
    void AddFadeOut()
    {
        FadeOut fo = gameObject.AddComponent <FadeOut> ();

        fo.multiColored  = false;
        fo.alphaFadeRate = 0.03f;
    }
        void DisplayOrHide(bool mouseOrTouchPresent)
        {
            isVisible = mouseOrTouchPresent;

            if (Locator.VideoPlayerVm.IsVideoPlayerAudioTracksSettingsVisible ||
                Locator.VideoPlayerVm.IsVideoPlayerOptionsPanelVisible ||
                Locator.VideoPlayerVm.IsVideoPlayerSubtitlesSettingsVisible ||
                Locator.VideoPlayerVm.IsVideoPlayerVolumeSettingsVisible)
            {
                return;
            }
            if (!isVisible)
            {
                ControlsGridFadeOut.Value = ControlsBorder.ActualHeight;
                HeaderGridFadeOut.Value   = -HeaderGrid.ActualHeight;
                FadeOut.Begin();

                Locator.MediaPlaybackViewModel.MouseService.HideCursor();
            }
            else
            {
                FadeIn.Begin();
                Locator.MediaPlaybackViewModel.MouseService.ShowCursor();
            }
        }
示例#4
0
 public void Update()
 {
     if (account != null)
     {
         FadeOut.Begin();
     }
 }
示例#5
0
    /// <summary>
    /// Creates fragments if necessary and destroys original gameobject
    /// </summary>
    public void explode()
    {
        //if fragments were not created before runtime then create them now
        if (fragments.Count == 0 && allowRuntimeFragmentation)
        {
            generateFragments();
        }
        //otherwise unparent and activate them
        else
        {
            foreach (GameObject frag in fragments)
            {
                FadeOut fo = frag.GetComponent <FadeOut>();
                fo.Prepare();
            }
        }
        //if fragments exist destroy the original
        if (fragments.Count > 0)
        {
            //gameObject.transform.position = pos;
            gameObject.GetComponent <Renderer>().enabled      = false;
            gameObject.GetComponent <Rigidbody2D>().simulated = false;
            exploding = true;
            explosionAudioSource.Play();

            Invoke("resetMe", 3);
        }
    }
示例#6
0
    // Start is called before the first frame update
    void Start()
    {
        canvasMenu     = this.transform.GetChild(1).gameObject.GetComponent <FadeOut>();
        canvasCreditos = this.transform.GetChild(2).gameObject.GetComponent <FadeOut>();

        canvasMenu.startFadeIn(null, 0f);
    }
示例#7
0
 // Use this for initialization
 void Start()
 {
     m_Control = false;
     m_PosFlag = 0;
     for (int i = 0; i < 4; i++)
     {
         m_PushStart[i] = false;
     }
     m_BasePos          = new Vector3(60.0f, 0.0f, 0.0f);
     m_Guide[0].m_Guide = this.transform.FindChild("Guide1").gameObject;
     m_Guide[1].m_Guide = this.transform.FindChild("Guide2").gameObject;
     m_Guide[2].m_Guide = this.transform.FindChild("Guide3").gameObject;
     m_Guide[3].m_Guide = this.transform.FindChild("Guide4").gameObject;
     m_Guide[4].m_Guide = this.transform.FindChild("Guide5").gameObject;
     m_Guide[5].m_Guide = this.transform.FindChild("Guide6").gameObject;
     m_FadeObject       = this.transform.FindChild("Fade").gameObject;
     for (int i = 0; i < 6; i++)
     {
         m_Guide[i].m_GuideScale = m_Guide[i].m_Guide.gameObject.GetComponent <TweenScale>();
         m_Guide[i].m_Alpha      = m_Guide[i].m_Guide.gameObject.GetComponent <TweenAlpha>();
         m_Guide[i].m_GuidePos   = m_Guide[i].m_Guide.transform.position;
         m_Guide[i].m_Sprite     = m_Guide[i].m_Guide.gameObject.GetComponent <UISprite>();
     }
     m_Fade = m_FadeObject.GetComponent <FadeOut>();
 }
示例#8
0
 void Start()
 {
     nextScene = "1_Login_Scene";
     fadeOut   = GameObject.Find("FadeOut").GetComponent <FadeOut>();
     StartCoroutine("LogoWork");
     StartCoroutine(LoadScene());
 }
示例#9
0
    // Second, after the fade out finishes, move the player and start a fade-in
    void endFadeOut()
    {
        moveToDor();
        FadeOut fo = Camera.main.GetComponent("FadeOut") as FadeOut;

        fo.DoFadeIn(5, endFadeIn);
    }
示例#10
0
 public void Enable(float duration = 0f)
 {
     foreach (Renderer childRenderer in GetComponentsInChildren <Renderer>())
     {
         if (childRenderer != null)
         {
             foreach (Material mat in childRenderer.materials)
             {
                 if (mat.shader.name == "dissolve")
                 {
                     StartCoroutine(UnDissolve(mat, duration > 0 ? duration : DefaultDuration));
                 }
                 else
                 {
                     FadeOut fade = childRenderer.gameObject.GetComponent <FadeOut>();
                     if (!fade)
                     {
                         fade = childRenderer.gameObject.AddComponent <FadeOut>();
                     }
                     fade.StartFadeIn(0, 2);
                 }
             }
         }
     }
 }
示例#11
0
    IEnumerator Workflow()
    {
        FadeIn fadeIn = logo.AddComponent <FadeIn>();

        fadeIn.time = 1.0f;
        fadeIn.Begin();
        yield return(new WaitForSeconds(2f));

        FadeOut fadeOut = logo.AddComponent <FadeOut>();

        fadeOut.time = 1.0f;
        fadeOut.Begin();
        yield return(new WaitForSeconds(1f));

        logo.SetActive(false);
        loadingLayer.SetActive(true);
        yield return(new WaitForEndOfFrame());

        MoveBy move = title.AddComponent <MoveBy>();

        move.offset = new Vector3(0, -2f, 0);
        move.time   = 1f;
        move.Begin();
        yield return(new WaitForSeconds(1f));

        async = SceneManager.LoadSceneAsync("MainScene");
        async.allowSceneActivation = false;
        yield return(StartCoroutine(Loading()));

        text.text      = "开始游戏";
        button.enabled = true;
    }
示例#12
0
    //public bool IsDead = false;

    private void Start()
    {
        ShoutMetre    = GameObject.Find("Post Process Canvas").transform.GetChild(0).GetComponent <Image>();
        ThisTransform = transform;
        Fade          = GetComponent <FadeOut>();
        Collider      = GetComponent <CapsuleCollider2D>();
    }
示例#13
0
    void OnTriggerExit(Collider other)
    {
        if (other.CompareTag(containerTag))
        {
            if (GetComponent <Rigidbody> () != null)
            {
                GetComponent <Rigidbody> ().velocity = Vector3.zero;
            }
            if (GetComponent <ConstantForwardMotion> () != null)
            {
                GetComponent <ConstantForwardMotion> ().enabled = false;
            }
            if (shouldFade)
            {
                FadeOut fo = gameObject.AddComponent <FadeOut> ();
                fo.multiColored  = false;
                fo.alphaFadeRate = 0.05f;

                foreach (Transform child in transform)
                {
                    FadeOut childFo = child.gameObject.AddComponent <FadeOut> ();
                    childFo.multiColored  = false;
                    childFo.alphaFadeRate = 0.05f;
                }
            }
            else
            {
                if (GetComponent <EnemyDie> () != null)
                {
                    GetComponent <EnemyDie> ().RegisterDeath();
                }
                Destroy(gameObject);
            }
        }
    }
示例#14
0
    //public Animator animator;
    //public string TriggerName;

    private void Start()
    {
        fi = GameObject.Find("QuestLocationText").GetComponent <FadeIn>();
        fo = GameObject.Find("QuestLocationText").GetComponent <FadeOut>();

        fi.fadeIn();
    }
示例#15
0
        void FadeOut_Completed(object sender, EventArgs e)
        {
            FadeOut.Stop();
            FadeIn.Stop();
            currentTextBlock.Text = textCollection[textCounter];
            textCounter++;
            if (textCounter == 5)
            {
                textCounter = 0;

                if (currentTextBlock == PageTitle)
                {
                    currentTextBlock = ApplicationTitle;
                }
                else
                {
                    currentTextBlock = PageTitle;
                }

                Storyboard.SetTarget(FadeIn, currentTextBlock);
                Storyboard.SetTarget(FadeOut, currentTextBlock);
            }

            FadeIn.Begin();
        }
示例#16
0
 public async Task TriggerFadeOut(bool b)
 {
     if (FadeOut != null)
     {
         await FadeOut.Invoke(b);
     }
 }
示例#17
0
 private void resetMe()
 {
     foreach (GameObject frag in fragments)
     {
         FadeOut fo = frag.GetComponent <FadeOut>();
         fo.Finish();
     }
     exploding = false;
 }
示例#18
0
 public SimpleAnimation()
 {
     InitializeComponent();
     PageFlip.Begin();
     currentTextBlock   = PageTitle;
     FadeOut.Completed += new EventHandler(FadeOut_Completed);
     FadeIn.Completed  += new EventHandler(FadeIn_Completed);
     FadeOut.Begin();
 }
    void Step1()
    {
        c2script.beginMovement = true;
        FadeOut fout = nucleolus.GetComponent <FadeOut>();

        fout.fade = true;
        //centreole2.transform.position = c2pos.transform.position;
        //S1SwapSpindles();
    }
示例#20
0
    public void GameOver()
    {
        FadeOut block = Instantiate(blockPrefab);

        block.StartFadeOut(onEnd: () =>
        {
            Instantiate(againStagePrefab);
        });
    }
示例#21
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject activarBlack = this.transform.GetChild(this.transform.childCount - 1).gameObject;

        activarBlack.SetActive(true);
        black = activarBlack.GetComponent <FadeOut>();
        black.startFadeOut(null, 0f);
        gameOver = this.transform.GetChild(1).gameObject.GetComponent <FadeOut>();
    }
示例#22
0
    //Game over and clear control
    public void Cleard()
    {
        FadeOut block = Instantiate(blockPrefab);

        block.StartFadeOut(onEnd: () =>
        {
            Instantiate(nextStagePrefab);
        });
    }
示例#23
0
            public static void UnityEventWithFade(SerializedProperty property, float faded, string label, DColor dColor, int eventsCount, bool indentContent = false, bool addExtraSpaceWhenExpanded = false)
            {
                float alpha = GUI.color.a;

                if (FadeOut.Begin(faded, indentContent))
                {
                    UnityEvent(property, label, dColor, eventsCount);
                }
                FadeOut.End(faded, addExtraSpaceWhenExpanded, alpha);
            }
示例#24
0
            public static void DrawWithFade(SerializedProperty property, float faded, float rowHeight, DColor dColor, float propertyWidth, bool indentContent = false, bool addExtraSpaceWhenExpanded = false)
            {
                float alpha = GUI.color.a;

                if (FadeOut.Begin(faded, indentContent))
                {
                    Draw(property, dColor, propertyWidth, rowHeight);
                }
                FadeOut.End(faded, addExtraSpaceWhenExpanded, alpha);
            }
示例#25
0
            public static void DrawWithFade(SerializedProperty property, float faded, DColor dColor, bool indentContent = false, bool addExtraSpaceWhenExpanded = false, params GUILayoutOption[] options)
            {
                float alpha = GUI.color.a;

                if (FadeOut.Begin(faded, indentContent))
                {
                    Draw(property, dColor, options);
                }
                FadeOut.End(faded, addExtraSpaceWhenExpanded, alpha);
            }
示例#26
0
            public static void DrawWithFade(SerializedProperty property, float faded, ColorName colorName, string emptyMessage = EMPTY_MESSAGE, float extraLineSpacing = 0, params GUILayoutOption[] options)
            {
                float alpha = GUI.color.a;

                if (FadeOut.Begin(faded, false))
                {
                    Draw(property, colorName, emptyMessage, extraLineSpacing, options);
                }
                FadeOut.End(faded, true, alpha);
            }
示例#27
0
    private void Awake()
    {
        m_MaterialFadeOut = new Material(Shader.Find("PlaneNoZTest"));

        CameraFadeOutEffect.FadeOutAction += DrawQuad;

        currentColor = Color.black;
        currentColor.a = 0;

    }
示例#28
0
 void Start()
 {
     // !!! 가비지 컬렉션 강제 실행 !!!
     //System.GC.Collect();
     // !!!!!!!!!!!!!!!!!!!!!
     fadeOut = GameObject.Find("FadeOut").GetComponent <FadeOut>();
     //TODO: 씬에서 고정적으로 Fade를 처리할경우
     //StartCoroutine(FADEOUT_FLASH());
     GameData.Instance.PanelItem = 3;
 }
示例#29
0
    private void Awake()
    {
        group = GetComponent <CanvasGroup>();
        FadeOut other = GetComponent <FadeOut>();

        if (other != null)
        {
            Destroy(other);
        }
    }
    private void Start()
    {
        audioEvents = new List <AudioEvent>(GetComponents <AudioEvent>());
        _fadeout    = GetComponent <FadeOut>();
        var index = SceneManager.sceneCount;

        LevelNameText.text = SceneManager.GetSceneAt(index - 1).name;

        Time.timeScale            = 1f;
        InputManager.DisableInput = false;
    }
示例#31
0
    public static void BreakUp(Sprite sprite, int size, int pixelsPerUnit, Vector3 position, float fadeOutTime)
    {
        // Get sprite texture
        Texture2D sourceTexture = sprite.texture;
        Vector2   pivot         = sprite.pivot;
        Rect      rect          = sprite.rect;

        Debug.Log(sprite.texture.name);

        // Get sprite width and height
        int width  = Mathf.FloorToInt(sprite.rect.width);
        int height = Mathf.FloorToInt(sprite.rect.height);


        int partNumber = 0;

        for (int i = 0; i < width / size; i++)
        {
            for (int j = 0; j < height / size; j++)
            {
                // Cut out the needed part from the texture
                Sprite newSprite = Sprite.Create(sourceTexture,
                                                 new Rect(rect.x + i * width / (width / size), rect.y + j * height / (height / size), size, size),
                                                 new Vector2(0f, 0f),
                                                 pixelsPerUnit);

                GameObject     gObject   = new GameObject();
                SpriteRenderer sRenderer = gObject.AddComponent <SpriteRenderer>();
                Rigidbody2D    rBody     = gObject.AddComponent <Rigidbody2D>();
                FadeOut        fOut      = gObject.AddComponent <FadeOut>();

                fOut.fadeOutTime = fadeOutTime;

                gObject.name = sprite.name + " part " + partNumber;

                sRenderer.sprite           = newSprite;
                sRenderer.color            = Color.white;
                sRenderer.sortingLayerName = "Local Displays";


                // Place every GameObject as it was in the original sprite
                gObject.transform.position = position + new Vector3(sprite.bounds.min.x + (sRenderer.sprite.rect.width / pixelsPerUnit) * i,
                                                                    sprite.bounds.min.y + (sRenderer.sprite.rect.width / pixelsPerUnit) * j,
                                                                    0);


                rBody.velocity       = new Vector2(Random.Range(-2f, 2f), Random.Range(3f, 6f));
                rBody.freezeRotation = true;


                partNumber++;
            }
        }
    }
示例#32
0
        /// <summary>
        /// メインゲームシーン
        /// </summary>
        /// <param name="content"></param>
        /// <param name="graphicsDevice"></param>
        /// <param name="input"></param>
        public GameIn(ContentManager content, GraphicsDevice graphicsDevice, GameTime gameTime, StageSelect.SelectStage selectStage, StageSelect.SelectEnemy selectEnemy)
        {
            this.content = content;
            this.graphicsDevice = graphicsDevice;

            this.selectStage = selectStage;

            // 乱数の初期化
            rand = new Random();

            // 迷路初期化。難易度によって大きさを変える
            maze = new Maze(content, selectStage);

            Point playerPosition;
            Point goalPosition;

            while (true)
            {
                playerPosition = maze.RandomPoint();
                goalPosition = maze.RandomPoint();

                // 迷路の斜辺の長さを求める。三平方の定理 c^2 = sqrt(a^2 + b^2)
                double hypotenuse = Math.Sqrt(maze.Width * maze.Width + maze.Height * maze.Height);

                // 0.5斜辺 < 距離 < 0.6斜辺ならOK
                double distance = Math.Sqrt((playerPosition.X - goalPosition.X) * (playerPosition.X - goalPosition.X) + (playerPosition.Y - goalPosition.Y) * (playerPosition.Y - goalPosition.Y));
                if (hypotenuse * 0.5 < distance && distance < hypotenuse * 0.6)
                {
                    break;
                }
            }

            //プレイヤー初期化
            player = new Player(content, playerPosition, Collidable.Collidable.Orientation.East, maze);

            //ゴール初期化
            goalobj = new GoalObject(content, goalPosition, Collidable.Collidable.Orientation.East, maze);

            // Enemyマネージャ初期化
            enemyManager = new EnemyManager(content, selectEnemy, selectStage, maze, player);

            //背景モデルの宣言
            backmodel = new BackGround(content);

            //カメラの初期設定
            camera = new Camera(player);

            // ミニマップの初期化
            miniMap = new MiniMap(content, graphicsDevice);

            // スコアの初期化
            score = new Score(content, graphicsDevice, gameTime, selectStage);

            //フェードアウト処理
            fadeout = new FadeOut(content, graphicsDevice, FadeOut.SceneType.InGame);

            // カウントダウン
            countdown = new CountDown(content, graphicsDevice, gameTime);

            // BGMの再生
            cueBGM = SoundManager.Instance.SoundBank.GetCue("game");
        }
示例#33
0
    // Use this for initialization
    void Start()
    {
        LOST = false;
        counter = 0;
        soundFX = false;
        audio.Play();
        pieces = 12;
        pieceHP = 100f;
        scale = 0.635f;
        hplengthMAX = scale*Screen.width;
        hplength = hplengthMAX;
        frame.x = 0.66f*Screen.width;
        frame.y = 100f;
        hpPOS.x = 15;
        hpPOS.y = 12;
        hpheight = 40;

        hungrySIZ.x = 650f;
        hungrySIZ.y = 100f;
        hungryPOS.x = (Screen.width-hungrySIZ.x)*0.5f;
        hungryPOS.y = 20f;

        ice = new GameObject[11];
        ice[0] = transform.Find("iceberg_1").gameObject;
        ice[1] = transform.Find("iceberg_2").gameObject;
        ice[2] = transform.Find("iceberg_3").gameObject;
        ice[3] = transform.Find("iceberg_4").gameObject;
        ice[4] = transform.Find("iceberg_5").gameObject;
        ice[5] = transform.Find("iceberg_6").gameObject;
        ice[6] = transform.Find("iceberg_7").gameObject;
        ice[7] = transform.Find("iceberg_8").gameObject;
        ice[8] = transform.Find("iceberg_9").gameObject;
        ice[9] = transform.Find("iceberg_10").gameObject;
        ice[10] = transform.Find("iceberg_11").gameObject;

        //		penguinSIZ = 30f;
        penguins = new bool[11];
        won_wave = false;
        degrade = false;
        wave_over = false;
        index = -1;
        speed = 4f;
        pause = false;

        for (int i = 0; i < 11; i++)
        {
            penguins[i] = true;
        }
        //		penguin1.x = 5f;
        //		penguin1.y = -88f;
        //		penguin2.x = 35f;
        //		penguin2.y = -53f;
        //		penguin3.x = 47f;
        //		penguin3.y = -15f;
        //		penguin4.x = 48f;
        //		penguin4.y = 43f;
        //		penguin5.x = 10f;
        //		penguin5.y = 63f;
        //		penguin6.x = -28f;
        //		penguin6.y = 78f;
        //		penguin7.x = -62f;
        //		penguin7.y = 58f;
        //		penguin8.x = -93f;
        //		penguin8.y = 25f;
        //		penguin9.x = -90f;
        //		penguin9.y = -26f;
        //		penguin10.x = -84f;
        //		penguin10.y = -66f;
        //		penguin11.x = -41f;
        //		penguin11.y = -87f;

        move = GetComponent<Movement>();
        world = GetComponent<World>();
        fadeI = GetComponent<FadeIn>();
        fadeO = GetComponent<FadeOut>();
        music = GetComponent<Sound>();
        fade1 = false;
        fade2 = false;
        world.enabled = true;

        levelSIZ.x = 600f;
        levelSIZ.y = 80f;
        levelPOS.y = Screen.height-86f+5f;
        levelPOS.x = Screen.height*0.75f;
        offset.x = 3f;
        offset.y = 3f;

        cam = GameObject.Find("Main Camera");
        Heal();
    }
示例#34
0
        /// <summary>
        /// ランキングシーン
        /// </summary>
        /// <param name="content"></param>
        /// <param name="graphicsDevice"></param>
        /// <param name="totalTime"></param>
        /// <param name="selectStage"></param>
        public Ranking(ContentManager content, GraphicsDevice graphicsDevice, TimeSpan totalTime, StageSelect.SelectStage selectStage)
        {
            this.content = content;
            this.graphicsDevice = graphicsDevice;

            //ステージサイズ取得
            this.selectStage = selectStage;

            //クリア時間取得
            this.totalTime = totalTime;

            LoadContent();

            NewRecordFlag = false;
            DrawFlag = true;
            //ランキングチェック
            newRank = checkRancking(totalTime, csvstr);

            //レコード更新フラグ確認
            if (newRank >= 0 && newRank <= 2)
                NewRecordFlag = true;

            //音声初期化
            cueBGM = SoundManager.Instance.SoundBank.GetCue("result");
            cueBGM.Play();

            fadeout = new FadeOut(content, graphicsDevice, FadeOut.SceneType.OutGame);
        }
示例#35
0
        /// <summary>
        /// ランキングシーン
        /// </summary>
        /// <param name="content"></param>
        /// <param name="graphicsDevice"></param>
        /// <param name="selectStage"></param>
        public Ranking(ContentManager content, GraphicsDevice graphicsDevice, StageSelect.SelectStage selectStage)
        {
            this.content = content;
            this.graphicsDevice = graphicsDevice;

            //ステージサイズ取得
            this.selectStage = selectStage;

            LoadContent();

            NewRecordFlag = false;
            DrawFlag = false;

            //音声初期化
            cueBGM = SoundManager.Instance.SoundBank.GetCue("result");
            cueBGM.Play();

            //フェードアウト初期化
            fadeout = new FadeOut(content, graphicsDevice, FadeOut.SceneType.OutGame);
        }