상속: MonoBehaviour
예제 #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);
    }
예제 #2
0
    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;
    }
예제 #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());
     }
 }
예제 #4
0
 public static void Initialize()
 {
     canvas = GameObject.Find("ManagerUI");
     if (popupText == null)
     {
         popupText = Resources.Load <FloatingText>("PopupTextParent");
     }
 }
예제 #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);
    }
예제 #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));
    }
예제 #8
0
 public static void Initialize()
 {
     canvas = GameObject.Find("Player UI");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("Others/PoPUpTextParent");
     }
 }
예제 #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");
     }
 }
예제 #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");
     }
 }
예제 #13
0
 // Use this for initialization
 void Start()
 {
     floatingText = this.GetComponent<FloatingText>();
     strings = new List<string> ();
     strings.Add ("");
     strings.Add ("");
     map = Ship.GetComponentInChildren<Map>();
 }
예제 #14
0
    public static void CreateFloatingCriticalText(string text, Transform location)
    {
        FloatingText instance = Instantiate(popupText2);

        instance.transform.SetParent(canvas.transform, false);
        instance.transform.SetAsFirstSibling();
        instance.SetText(text);
    }
예제 #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");
     }
 }
예제 #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");
     }
 }
예제 #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");
     }
 }
예제 #21
0
    void Start()
    {
        powerCount   = 0;
        floatingText = new FloatingText(anchor.GetComponentInChildren <RectTransform>().localPosition, transform, counterFont, counterFontSize, TMPro.TextAlignmentOptions.Left);

        powerImageList = new List <SpriteRenderer>();
        AddPower();
    }
예제 #22
0
 public void Start()
 {
     canvas = GameObject.Find("Interface");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("Prefabs/PopupTextParent");
     }
 }
예제 #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);
    }
예제 #24
0
파일: Player.cs 프로젝트: woyaoqustf/gdfg
    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);
    }
예제 #25
0
 public static void Initialize(FloatingText floatingText)
 {
     canvas = GameObject.FindWithTag("Canvas");
     if (!popupText)
     {
         popupText = floatingText;
     }
 }
예제 #26
0
 private void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Player")
     {
         FloatingText.ShowMessage("BONUS COIN", playerTransform.position + new Vector3(0, 0, -1));
         Destroy(gameObject);
     }
 }
예제 #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);
    }
예제 #28
0
 private void Initialize()
 {
     canvas = GameObject.Find("UI(Clone)/World Canvas");
     if (!popupText)
     {
         popupText = Resources.Load <FloatingText>("UI/PopupTextParent");
     }
 }
예제 #29
0
 public static void Initialize()
 {
     canvas = GameObject.Find("Canvas");
     if (!criticalpopupText)
     {
         criticalpopupText = Resources.Load <FloatingText>("Prefabs/CriticalPopUpTextParent");
     }
 }
예제 #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");
    }
예제 #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");

	}
예제 #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");
 }
예제 #35
0
 public void AddText(FloatingText text)
 {
     m_floatingTexts.Enqueue(text);
 }
예제 #36
0
 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);
 }