示例#1
0
 // Use this for initialization
 void Start()
 {
     sprite = GetComponent <SpriteRenderer> ();
     sprite.sortingOrder = 0;
     fadeInOut           = GetComponent <FadeInOut> ();
     fadeInOut.SetOpacity(0.17f);
 }
示例#2
0
 void Start()
 {
     hp          = maxHp;
     fader       = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <FadeInOut>();
     colorCurves = GameObject.FindGameObjectWithTag(Tags.mainCamera).GetComponent <ColorCorrectionCurves>();
     BleedBehavior.BloodAmount = 0;
 }
示例#3
0
        //private BrainMapMarker currentMapMarker = null;
        public BrainMapManager(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, InputManager controls, Vector2 position)
        {
            this.audioManager = audioManager;
            bg = new Sprite(spriteBatch, game, Constants.BRAIN_MAP_BG);
            mapList = new List<BrainMapMarker>();

            List<BrainMapMarker> tmpList = new List<BrainMapMarker>();
            /*mapList.Add(tmpList);
            tmpList = new List<BrainMapMarker>();
            mapList.Add(tmpList);
            tmpList = new List<BrainMapMarker>();
            mapList.Add(tmpList);*/

            menuManager = new MenuManager(controls);
            ImageButton button = new ImageButton(spriteBatch, game, controls, new Vector2((float)Constants.RESOLUTION_VIRTUAL_WIDTH * 0.5f - 150, (float)Constants.RESOLUTION_VIRTUAL_HEIGHT * 0.5f + 200), Constants.GUI_CLEANSE, "cleanse");
            button.onClick += new ImageButton.ButtonEventHandler(OnButtonPress);
            menuManager.AddButton(button);
            button = new ImageButton(spriteBatch, game, controls, new Vector2((float)Constants.RESOLUTION_VIRTUAL_WIDTH * 0.5f + 150, (float)Constants.RESOLUTION_VIRTUAL_HEIGHT * 0.5f + 200), Constants.GUI_BACK, "back");
            button.onClick += new ImageButton.ButtonEventHandler(OnButtonPress);
            menuManager.AddButton(button);
            menuManager.initialize();
            fadeinOut = new FadeInOut(spriteBatch, game, 100);
            this.position = position;
            offset = new Vector2((float)bg.X * 0.5f, (float)bg.Y *0.5f);
            this.controls = controls;
        }
示例#4
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
示例#5
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.B))
     {
         StartCoroutine(FadeInOut.FadeImage(a, 3f, A1));
     }
 }
示例#6
0
 void Start()
 {
     fadeInOut = gameObject.GetComponent <FadeInOut> ();
     fadeInOut.Hide();
     Subscribe();
     CheckEnter();
 }
示例#7
0
    void OnWinGameEvent(WinGameEvent e)
    {
        FadeInOut fade = GetComponent <FadeInOut>();

        fade.StartFade(FadeInOut.FadeDirection.FadeOut);
        _timerStarted = true;
    }
 public void ActivateLevel(bool flag, bool isHard = false)
 {
     foreach (FadeInOut entity in entityFaders)
     {
         if (isHard)
         {
             entity.HardASet(flag ? 1 : 0, flag);
         }
         else
         {
             entity.SetIsFadeIn(flag);
         }
     }
     if (isHard)
     {
         myFader.HardASet(flag ? 1 : 0, flag);
     }
     else
     {
         if (myFader)
         {
             myFader.SetIsFadeIn(flag);
         }
         else
         {
             myFader = GetComponent <FadeInOut>();
             myFader.SetIsFadeIn(flag);
         }
     }
 }
    // Use this for initialization
    void Start()
    {
        fadeController = GameObject.Find("Fader").GetComponent <FadeInOut>();
        buttonHandler  = GameObject.Find("GameOverMenu").GetComponent <GameOverButtonHandler>();

        Invoke("MenuStart", 0.25f);
    }
示例#10
0
    // Update is called once per frame
    void Update()
    {
        if (countDown == null)
        {
            return;
        }

        if (TriggerBox.playerOneIsReady && TriggerBox.playerTwoIsReady)
        {
            timer -= Time.deltaTime;
            int intTime = Mathf.CeilToInt(timer);
            countDown.text = intTime.ToString();
            if (intTime <= 0)
            {
                FadeInOut fade = fadeCanvas.GetComponent <FadeInOut> ();
                fade.fadeWay = FadeInOut.Fade.FadeOut;
                fade.delay   = 0.2f;
                desiredZPos  = -250f;
                StartCoroutine(CamAnimation());
            }
        }
        else
        {
            timer          = countDownSec;
            countDown.text = timer.ToString();
        }
    }
示例#11
0
    private void Awake()
    {
        fadeInOut = GetComponent <FadeInOut>();
        Renderer renderer = GetComponent <Renderer>();

        renderer.enabled = false;
    }
    // Use this for initialization
    void Start()
    {
        fadeController = GameObject.Find("Fader").GetComponent<FadeInOut>();
        buttonHandler = GameObject.Find("GameOverMenu").GetComponent<GameOverButtonHandler>();

        Invoke("MenuStart", 0.25f);
    }
示例#13
0
    private FadeInOut fader; //FadeInOutスクリプト


    void Start()
    {
        //初期化
        hp    = maxHp;
        fader = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <FadeInOut>();
        BleedBehavior.BloodAmount = 0;
    }
示例#14
0
    private void Awake()
    {
        pScriptTempObject = GetComponent <FadeInOut>();
        pThisButtonAni    = this.GetComponent <Animation>();

        m_StaticMember = (StaticMemberManager)GameObject.Find("StaticMemberManager").
                         gameObject.GetComponent <StaticMemberManager>();
    }
示例#15
0
        private void _ShowItem(string itemName, Func <UIElement> createItem, Action complete)
        {
            if (_itemName == itemName)
            {
                return;
            }
            var finded = false;

            foreach (FrameworkElement item in container.Children)
            {
                var show = GetItem(item) == itemName;
                if (show)
                {
                    _itemName       = itemName;
                    item.Visibility = Visibility.Visible;
                    _pipeline.IncrementAsync();
                    FadeInOut.RaisePreFadeIn(item);
                    Animations.OpacityOut(item, 500, EasingMode.EaseOut, () =>
                    {
                        FadeInOut.RaiseFadedIn(item);
                        complete();
                    });
                    finded = true;
                }
                else
                {
                    if (item.Visibility == Visibility.Visible)
                    {
                        _pipeline.IncrementAsync();
                        FadeInOut.RaisePreFadeOut(item);
                        Animations.OpacityIn(item, 500, EasingMode.EaseOut, () =>
                        {
                            item.Visibility = Visibility.Collapsed;
                            FadeInOut.RaiseFadedOut(item);
                            complete();
                        });
                    }
                }
            }

            if (!finded && createItem != null)
            {
                //自动添加项,并显示
                var item = createItem();
                TabPanel.SetItem(item, itemName);
                container.Children.Add(item);
                item.Visibility = Visibility.Visible;

                _pipeline.IncrementAsync();
                FadeInOut.RaisePreFadeIn(item);
                Animations.OpacityOut(item, 500, EasingMode.EaseOut, () =>
                {
                    FadeInOut.RaiseFadedIn(item);
                    complete();
                });
                _itemName = itemName;
            }
        }
示例#16
0
    public void FadeOut(bool activeState, float time, System.Action action)
    {
        FadeInOut fade = Get <FadeInOut>(UIList.FadeInOut);

        if (fade != null)
        {
            fade.FadeOut(activeState, time, action);
        }
    }
示例#17
0
    public void ReloadScene(bool reload)
    {
        FadeInOut fade = fadeCanvas.GetComponent <FadeInOut> ();

        fade.fadeWay = FadeInOut.Fade.FadeOut;
        fade.delay   = 0.2f;
        desiredZPos  = -250f;
        StartCoroutine(waitTillFinish(reload));
    }
示例#18
0
    IEnumerator ChangeLevel()
    {
        FadeInOut fadeInOut = GameObject.Find("Character Main Camera").GetComponent <FadeInOut>();
        float     fadeTime  = fadeInOut.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
示例#19
0
    private ColorCorrectionCurves colorCurves; //实现死亡时相机画面逐渐变为黑白效果的脚本(内置资源包)

    void Start()
    {
        hp    = maxHp;//玩家当前生命值为最大值
        fader = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent <FadeInOut>();
        //出现渐隐效果
        colorCurves = GameObject.FindGameObjectWithTag(Tags.mainCamera).GetComponent <ColorCorrectionCurves>();
        //出现黑白效果
        BleedBehavior.BloodAmount = 0;//血红效果为0(在武器相机中设置)
    }
示例#20
0
 void Awake()
 {
     fade = this;
     img  = GetComponent <Image>();
     if (start_fadeout)
     {
         FadeOut();
     }
 }
示例#21
0
 void Start()
 {
     wave       = GameObject.Find("WaveChange").GetComponent <WaveChange>();
     move       = GameObject.Find("unitychan").GetComponent <PlayerMove>();
     fade       = GameObject.Find("FadePanel").GetComponent <FadeInOut>();
     anime      = GameObject.Find("unitychan").GetComponent <Animator>();
     voice      = GameObject.Find("unitychan").GetComponent <UnityVoice>();
     unityAnime = GameObject.Find("unitychan").GetComponent <UnitychanAnimation>();
 }
    void Start()
    {
        spawnController = GameObject.Find("Spawner").GetComponent<Spawner_Script>();
        distanceController = GameObject.Find("_DistanceController").GetComponent<DistanceController>();
        fadeController = GameObject.Find("Fader").GetComponent<FadeInOut>();
        gameOver = GameObject.Find("GameOver").GetComponent<GameOver>();

        Invoke("stageStart", 0.25f);
        Invoke("startGame", 3.0f);
    }
示例#23
0
    void Start()
    {
        spawnController    = GameObject.Find("Spawner").GetComponent <Spawner_Script>();
        distanceController = GameObject.Find("_DistanceController").GetComponent <DistanceController>();
        fadeController     = GameObject.Find("Fader").GetComponent <FadeInOut>();
        gameOver           = GameObject.Find("GameOver").GetComponent <GameOver>();

        Invoke("stageStart", 0.25f);
        Invoke("startGame", 3.0f);
    }
示例#24
0
    //残影的淡入淡出  对象、位置、旋转、存在时间
    private void InitFadeInObj(GameObject go, Vector3 position, Quaternion rotation, float lifeCycle)
    {
        go.hideFlags          = HideFlags.HideAndDontSave;
        go.transform.position = position;
        go.transform.rotation = rotation;
        FadeInOut fi = go.AddComponent <FadeInOut>();

        fi.lifeCycle = lifeCycle;
        objs.Add(go);        //加入列表
    }
示例#25
0
 public void Close(Action complete)
 {
     FadeInOut.RaisePreFadeOut(this);
     Animations.OpacityIn(this, 500, EasingMode.EaseOut, () =>
     {
         this.Visibility = Visibility.Collapsed;
         FadeInOut.RaiseFadedOut(this);
         complete();
     });
 }
示例#26
0
 /// <summary>
 /// 预加载视图使用该方法模拟打开时应该触发的事件
 /// </summary>
 internal void SimulateOpen()
 {
     FadeInOut.RaisePreFadeIn(this);
     if (!_isRendered)
     {
         _isRendered = true;
         Rendered();
     }
     FadeInOut.RaiseFadedIn(this);
 }
示例#27
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        bg.color = new Vector4(0, 0, 0, 1);
        bg.gameObject.SetActive(true);
    }
示例#28
0
    private void Awake()
    {
        S = this;
        spriteRenderer = GetComponent <SpriteRenderer>();
        fadeOut        = false;
        Color temp = spriteRenderer.color;

        temp.a = 1;
        spriteRenderer.color = temp;
    }
示例#29
0
 private void Awake()
 {
     if (this._element == null)
     {
         this._element = this.GetComponent <FadeInOut>();
     }
     if (this._element == null)
     {
         Debug.LogWarning("_element is not set and no FadeInOut component was found");
     }
 }
示例#30
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         StartCoroutine(FadeInOut.FadeImage(image1, 5f, color1));
     }
     else if (Input.GetKeyDown(KeyCode.B))
     {
         StartCoroutine(FadeInOut.FadeImage(image2, 5f, color2));
     }
 }
示例#31
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         StartCoroutine(FadeInOut.FadeImage(red, 10F, a));
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         StartCoroutine(FadeInOut.FadeImage(blue, 10F, b));
     }
 }
示例#32
0
    //*****************************************************


    void Start()
    {
        music  = GetComponent <AudioSource> ();
        scorer = FindObjectOfType <ScoreKeeper> ();
        fader  = GetComponent <FadeInOut> ();
        //Not the best way to get the credits Mesh Renderer, but as long as it is neither destroyed
        //nor duplicated this way should suffice.
        credits = GameObject.Find("Credits").GetComponent <MeshRenderer> ();
        FindForceDirTest();
        music.Play();
    }
    void Start()
    {
        devText = GameObject.Find("Distance Text").GetComponent<Text>();
        devBossText = GameObject.Find("Boss Text").GetComponent<Text>();
        fader = GameObject.Find("Fader").GetComponent<FadeInOut>();
        gameController = GameObject.Find("_GameController").GetComponent<GameController>();

        bg[0] = GameObject.Find("Road_BG").GetComponent<MeshRenderer>();
        bg[1] = GameObject.Find("Beach_BG").GetComponent<MeshRenderer>();
        bg[2] = GameObject.Find("Forest_BG").GetComponent<MeshRenderer>();
    }
示例#34
0
 private void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
示例#35
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
示例#36
0
	// Use this for initialization
	void Awake () {



		_count_text [0] = "「本番5秒前!!」";
		_count_text [1] = "「4」";
		_count_text [2] = "「3」";
		_count_text [3] = "「2」";
		_count_text [4] = "「1...」";

		_title_logo_ref = GameObject.FindObjectOfType<FadeInOut> ();
		_camera = GameObject.FindObjectOfType<ChangeCamera> ();
		_message_panel.enabled = false;
	
	}
示例#37
0
    void Start()
    {
        instance = this;
        trigger = false;

        BlackImg = gameObject.GetComponent<Image>();
        vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>();

        if (vignette != null)
        {
            fade_PlayerDead_Info.Vgnetting_min = vignette.intensity;
            fade_PlayerDead_Info.chromaticAberration_min = vignette.chromaticAberration;
        }

    }
 void Start()
 {
     fadeinout = GameObject.Find("Main Camera").GetComponent<FadeInOut>();
 }
 void Start()
 {
     fadeController = GameObject.Find("Fader").GetComponent<FadeInOut>();
 }
	void Awake() { 
		_instance = this; 
		GetComponent<GUITexture>().pixelInset = new Rect (0f, 0f, Screen.width, Screen.height);
	}
示例#41
0
 // This fade from transparent to all black.
 public void FadeOut()
 {
     fade = FadeInOut.Out;
 }
示例#42
0
 // This fade from all black to transparent.
 public void FadeIn()
 {
     fade = FadeInOut.In;
 }
    void Start()
    {
        fader = GameObject.FindGameObjectWithTag("Fader").GetComponent<FadeInOut>();

        StartCoroutine(fader.FadeIn());
    }
示例#44
0
    void Awake()
    {
        this.transform.tag = Tags.PLAYER;

        _myPlatformerMovement = gameObject.AddComponent<PlatformerMovement>();

        _attackCatcher = gameObject.AddComponent<AttackCather> ();
        _clashAble = gameObject.AddComponent<ClashAble> ();
        _basicAttack = gameObject.AddComponent<BasicStunAttack> ();
        _playerTransformer = gameObject.AddComponent<PlayerTransformer> ();
        gameObject.AddComponent<TouchDetector2D> ();
        gameObject.AddComponent<LandOnTopKill> ();
        rigidBody = gameObject.GetComponent<Rigidbody2D> ();
        _playerAnimHandler = gameObject.AddComponent<PlayerAnimationHandler> ();
        gameObject.AddComponent<RigidbodyUtil2D>();

        _fader = gameObject.AddComponent<FadeInOut> ();

        gameObject.AddComponent<PlayerEffects>();
        gameObject.AddComponent<PlayerSoundHandler>();

        _stunTimer = gameObject.AddComponent<ComTimer> ();

        _stunTimer.TimerEnded += StunTimerEnded;

        _attackCatcher.OnStunAttackCatch += OnStunHit;
        _attackCatcher.OnStunKillAttackCatch += OnStunKillHit; // if Jump on my head hit while in stun
        _attackCatcher.OnKillAttackCatch += OnKillHit;
    }
示例#45
0
 void Start()
 {
     fader = GameObject.FindObjectOfType<FadeInOut>();
 }