Inheritance: MonoBehaviour
Beispiel #1
0
    public void SpawnFT( )
    {
        Debug.Log("Spawning FT...");
        GameObject   go = Instantiate(floatingText.gameObject, new Vector3(-22, 0, 0), Quaternion.identity);
        FloatingText ft = go.GetComponent <FloatingText>( );

        ft.SetPrameters(Random.Range(1, 10).ToString( ), true, 1.0f, 1.0f, Color.white);
    }
    public static void CreateFloatingText(string text, Transform location)
    {
        FloatingText instance       = Instantiate(popupText);
        Vector2      screenPosition = Camera.main.WorldToScreenPoint(location.position);

        instance.transform.SetParent(canvas.transform, true);
        instance.transform.position = screenPosition;
    }
Beispiel #3
0
 public void KillPlayer()
 {
     if (!Player.IsDead)
     {
         FloatingText.Show("DEATH", "PointsText", new FromWorldPointTextPositioner(Camera.GetComponent <Camera>(), Player.transform.position, 1.5f, 50));
         StartCoroutine(KillPlayerCo());
     }
 }
 public static void Initialize()
 {
     canvas = GameObject.Find("ManagerUI");
     if (popupText == null)
     {
         popupText = Resources.Load <FloatingText>("PopupTextParent");
     }
 }
Beispiel #5
0
    private static FloatingText CreateText(Transform location)
    {
        FloatingText instance       = Instantiate(popupText, canvas.transform, false);
        Vector2      screenPosition = Camera.main.WorldToScreenPoint(new Vector2(location.position.x, location.position.y + 0.5f));

        instance.transform.position = screenPosition;
        return(instance);
    }
Beispiel #6
0
    public void CreatingText(string text)
    {
        FloatingText instance = Instantiate(screenText);

        instance.transform.SetParent(this.transform, false);
        instance.GetComponent <FloatingText>().SetText(text);
        instance.GetComponent <FloatingText>().button.onClick.AddListener(Flag);
    }
    private IEnumerator PlayerHitCheckpointCo(int bonus)
    {
        // (***)
        FloatingText.Show("Checkpoint!", "CheckpointText", new CenteredTextPositioner(.5f));
        yield return(new WaitForSeconds(.5f));

        FloatingText.Show(string.Format("+{0} Time Bonus!", bonus), "CheckpointText", new CenteredTextPositioner(.5f));
    }
 public static void Initialize()
 {
     canvas = GameObject.Find("Player UI");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("Others/PoPUpTextParent");
     }
 }
Beispiel #9
0
    public static void SlerpTextCrit(string text, Vector3 pos)
    {
        FloatingText pooledComponent = BindingManager.Instance.CritTextsPool.GetPooledComponent <FloatingText>();
        Vector3      position        = BindingManager.Instance.UICamera.ViewportToWorldPoint(Camera.main.WorldToViewportPoint(pos));

        pooledComponent.transform.position = position;
        pooledComponent.FloatText(text);
    }
 public static void InitializeFloatingText()
 {
     canvas = GameObject.Find("Canvas");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("Prefabs/PopupTextParent");
     }
 }
Beispiel #11
0
    public static void CreateFloatingText(string text, WorldPosition position)
    {
        FloatingText instance = Instantiate(popupText);

        instance.transform.SetParent(canvas.transform, false);
        instance.transform.position = Camera.main.WorldToScreenPoint(position.ToVector3());
        instance.SetDamageText(text);
    }
 public static void Initialize()
 {
     canvas = GameObject.Find("Canvas");
     if (!popuptext)
     {
         popuptext = Resources.Load <FloatingText>("PreFab/PopUpParent");
     }
 }
 // Use this for initialization
 void Start()
 {
     floatingText = this.GetComponent<FloatingText>();
     strings = new List<string> ();
     strings.Add ("");
     strings.Add ("");
     map = Ship.GetComponentInChildren<Map>();
 }
    public static void CreateFloatingCriticalText(string text, Transform location)
    {
        FloatingText instance = Instantiate(popupText2);

        instance.transform.SetParent(canvas.transform, false);
        instance.transform.SetAsFirstSibling();
        instance.SetText(text);
    }
Beispiel #15
0
 public static void Initialize()
 {
     canvas = GameObject.Find("MobileSingleStickControl");
     if (!popupTextPrefab)
     {
         popupTextPrefab = Resources.Load <FloatingText>("Prefabs/PopupTextParent");
     }
 }
 // In controller for combat scene, need to call following functions on start.
 public static void DamageEnemy()
 {
     canvas = GameObject.Find("Canvas");
     if (!damageEnemyText)
     {
         damageEnemyText = Resources.Load <FloatingText>("Prefabs/FeedbackText/ParentObjects/DamageEnemyTextParent");
     }
 }
Beispiel #17
0
    private IEnumerator PlayerHitCheckpointCo(int bouns)
    {
        FloatingText.Show("Check point!", "CheckpointText", new CenteredTextPositioner(.3f));
        yield return(new WaitForSeconds(.5f));

        FloatingText.Show(string.Format("+{0} time bouns!", bouns), "CheckpointText", new CenteredTextPositioner(.3f));
        //yield break;
    }
 public static void Miss()
 {
     canvas = GameObject.Find("Canvas");
     if (!missText)
     {
         missText = Resources.Load <FloatingText>("Prefabs/FeedbackText/ParentObjects/MissTextParent");
     }
 }
Beispiel #19
0
    public void CreateFloatingTextForDamage(float damage, Vector3 worldPosition)
    {
        FloatingText floatingText = reusableFloatingTexts.Count > 0 ? reusableFloatingTexts.Pop() : Instantiate(ResourceUtility.GetGUIPrefab <FloatingText>("FloatingText"), transform);

        floatingText.Text = Mathf.FloorToInt(damage).ToString();
        floatingText.transform.position = Camera.main.WorldToScreenPoint(worldPosition);
        floatingText.gameObject.SetActive(true);
    }
 public static void HealAlly()
 {
     canvas = GameObject.Find("Canvas");
     if (!healAllyText)
     {
         healAllyText = Resources.Load <FloatingText>("Prefabs/FeedbackText/ParentObjects/HealAllyTextParent");
     }
 }
Beispiel #21
0
    void Start()
    {
        powerCount   = 0;
        floatingText = new FloatingText(anchor.GetComponentInChildren <RectTransform>().localPosition, transform, counterFont, counterFontSize, TMPro.TextAlignmentOptions.Left);

        powerImageList = new List <SpriteRenderer>();
        AddPower();
    }
 public void Start()
 {
     canvas = GameObject.Find("Interface");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("Prefabs/PopupTextParent");
     }
 }
Beispiel #23
0
    public static FloatingText TextPopup(Vector3 position, string text)
    {
        Transform    FloatingTextTransform = Instantiate(GameAssets.instance.floatingDamagePrefab, position + new Vector3(0, 2), Quaternion.identity);
        FloatingText textPopup             = FloatingTextTransform.GetComponent <FloatingText>();

        textPopup.SetupText(text);
        return(textPopup);
    }
Beispiel #24
0
    public void giveHealth(int health, GameObject instagator)
    {
        AudioSource.PlayClipAtPoint(PlayerHealthsound, transform.position);
        FloatingText.Show(string.Format("+{0}", health), "PlayerGotHealthText",
                          new FromWorldPointTextPositioner(Camera.main, transform.position, 2f, 60f));

        Health = Mathf.Min(Health + health, MaxHealth);
    }
Beispiel #25
0
 public static void Initialize(FloatingText floatingText)
 {
     canvas = GameObject.FindWithTag("Canvas");
     if (!popupText)
     {
         popupText = floatingText;
     }
 }
Beispiel #26
0
 private void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Player")
     {
         FloatingText.ShowMessage("BONUS COIN", playerTransform.position + new Vector3(0, 0, -1));
         Destroy(gameObject);
     }
 }
Beispiel #27
0
    void FloatingText(string message)
    {
        FloatingText popupText = Resources.Load <FloatingText>("Prefabs/PopupTextParent");
        FloatingText instance  = Instantiate(popupText);

        instance.transform.SetParent(transform, false);
        instance.SetText(message);
    }
 private void Initialize()
 {
     canvas = GameObject.Find("UI(Clone)/World Canvas");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("UI/PopupTextParent");
     }
 }
Beispiel #29
0
 public static void Initialize()
 {
     canvas = GameObject.Find("Canvas");
     if (!criticalpopupText)
     {
         criticalpopupText = Resources.Load <FloatingText>("Prefabs/CriticalPopUpTextParent");
     }
 }
Beispiel #30
0
    void Awake()
    {
        instance = this;
        canvas   = GameObject.Find("CanvasWithIgnores").transform;

        popupText_Player = Resources.Load <FloatingText>("PopupTextParent_Player");
        popupText_Enemy  = Resources.Load <FloatingText>("PopupTextParent_Enemy");
    }
Beispiel #31
0
    public static void CreateFloatingTextEarth(string text, Transform location)
    {
        FloatingText instance       = Instantiate(PopUpTextEarth);
        Vector2      screenPosition = Camera.main.WorldToScreenPoint(location.position);

        instance.transform.SetParent(canvas.transform, false);
        instance.transform.position = screenPosition;
        instance.SetText(text);
    }
	public static void Initialize () {

		gameCanvas = GameObject.Find("Level Canvas");
		popUpTextZombie = Resources.Load<FloatingText>("Prefabs/PopupTextZombie");
		popUpTextPlayer = Resources.Load<FloatingText>("Prefabs/PopupTextPlayer");
		popUpCritText = Resources.Load<FloatingText>("Prefabs/PopupCritText");

		gunBlast = Resources.Load<WeaponGFX>("Prefabs/GunBlast");
		clubSwing = Resources.Load<WeaponGFX>("Prefabs/ClubSwing");
		knifeStab = Resources.Load<WeaponGFX>("Prefabs/KnifeStab");

	}
Beispiel #33
0
        // void __thiscall sub_C83F00(void *this, int a2, unsigned int a3, int a4, float a5, void *a6)
        public DetourFloatingText()
        {
            try {

                IntPtr floatingTextPointer = new IntPtr(Memory.LOLBaseAddress+Offsets.FloatingText);
                FloatingTextDelegate = (FloatingText)Marshal.GetDelegateForFunctionPointer(floatingTextPointer, typeof(FloatingText));

                Memory.GetMagic.Detours.CreateAndApply(FloatingTextDelegate,new FloatingText(this.PrintChatDetour),"floatingText");

            } catch (Exception ex) {

                Frame.Log(ex.ToString());
            }
        }
 public static void Initialize()
 {
     canvas = GameObject.FindWithTag("PlayerData");
     popupText = Resources.Load<FloatingText>("Prefabs2/PopupTextParent");
 }
 public void AddText(FloatingText text)
 {
     m_floatingTexts.Enqueue(text);
 }
 public static void AddText(string text, Vector3 position, Vector3 speed, float fontSize, float lifeTime, Color color)
 {
     var floatingText = new FloatingText(text, position, speed, fontSize, lifeTime, color);
     floatingTextList.Add(floatingText);
 }