Esempio n. 1
0
        public override void Initialize()
        {
            base.Initialize();

            var overlay = new EffectOverlay(this, prototypeManager, _mapManager);

            overlayManager.AddOverlay(overlay);
        }
Esempio n. 2
0
        public override void Initialize()
        {
            base.Initialize();
            IoCManager.InjectDependencies(this);

            var overlay = new EffectOverlay(this);
            overlayManager.AddOverlay(overlay);
        }
Esempio n. 3
0
        public override void Initialize()
        {
            base.Initialize();

            SubscribeNetworkEvent <EffectSystemMessage>(CreateEffect);
            SubscribeLocalEvent <EffectSystemMessage>(CreateEffect);

            var overlay = new EffectOverlay(this, prototypeManager, _mapManager);

            overlayManager.AddOverlay(overlay);
        }
Esempio n. 4
0
    IEnumerator DamageOverlayRoutine(EffectOverlay eff)
    {
        effectOverlayList.Add(eff);
        float duration = 0;

        while (duration < 1)
        {
            eff.pos    += new Vector3(0, 1.5f * Time.deltaTime, 0);
            eff.color.a = 1 - duration;

            duration += Time.deltaTime * 1.5f;
            yield return(null);
        }
        effectOverlayList.Remove(eff);
    }
Esempio n. 5
0
 public void OnEffectOverlay(EffectOverlay eff)
 {
     effectOverlayList.Add(eff);
     if (!eff.useColor)
     {
         //StartCoroutine(DamageOverlayRoutine(eff, eff.pos, eff.msg, color));
         eff.color = UI.colorH;
         StartCoroutine(DamageOverlayRoutine(eff));
     }
     else
     {
         //StartCoroutine(DamageOverlayRoutine(eff, eff.pos, eff.msg, eff.color));
         StartCoroutine(DamageOverlayRoutine(eff));
     }
 }
Esempio n. 6
0
    void DrawOverlay()
    {
        GUIStyle style = new GUIStyle();

        style.fontStyle = FontStyle.Bold;
        style.alignment = TextAnchor.UpperCenter;
        style.fontSize  = 16;

        for (int i = 0; i < effectOverlayList.Count; i++)
        {
            EffectOverlay effect    = effectOverlayList[i];
            Camera        cam       = CameraControl.GetActiveCamera();
            Vector3       screenPos = cam.WorldToScreenPoint(effect.pos);
            screenPos.y = Screen.height - screenPos.y;

            style.normal.textColor = new Color(0, 0, 0, effect.color.a);
            GUI.Label(new Rect(screenPos.x - 50 + 2, screenPos.y + 2, 100, 40), effect.msg, style);
            style.normal.textColor = effect.color;
            GUI.Label(new Rect(screenPos.x - 50, screenPos.y, 100, 40), effect.msg, style);
        }
    }
Esempio n. 7
0
	IEnumerator DamageOverlayRoutine(EffectOverlay eff){
		effectOverlayList.Add(eff);
		float duration=0;
		while(duration<1){
			eff.pos+=new Vector3(0, 1.5f*Time.deltaTime, 0);
			eff.color.a=1-duration;
			
			duration+=Time.deltaTime*1.5f;
			yield return null;
		}
		effectOverlayList.Remove(eff);
	}
Esempio n. 8
0
	public void OnEffectOverlay(EffectOverlay eff){
		effectOverlayList.Add(eff);
		if(!eff.useColor){
			//StartCoroutine(DamageOverlayRoutine(eff, eff.pos, eff.msg, color));
			eff.color=UI.colorH;
			StartCoroutine(DamageOverlayRoutine(eff));
		}
		else{
			//StartCoroutine(DamageOverlayRoutine(eff, eff.pos, eff.msg, eff.color));
			StartCoroutine(DamageOverlayRoutine(eff));
		}
	}