示例#1
0
        protected virtual void Start()
        {
            movementController = new MovementController();

            rigidBody = GetComponent<Rigidbody2D>();

            var go = new GameObject("Weapon", typeof(Weapon)).GetComponent<Weapon>();
            go.transform.parent = transform;
            go.SetSprite(weapon.sprite);
            go.bullet = weapon.bullet;
        }
示例#2
0
        public void ShowTooltip(string resourceName, string axis, bool useCookie)
        {
            if (!useCookie || PlayerPrefs.GetInt("UITooltip" + resourceName, 0) == 0)
            {
                PlayerPrefs.SetInt("UITooltip" + resourceName, 1);
                UITooltip tooltip = new GameObject("UITooltip", typeof(UITooltip)).GetComponent<UITooltip>();

                tooltip.gameObject.transform.SetParent(transform, false);
                tooltip.SetAxis(axis);
                tooltip.SetSprite(Resources.Load<Sprite>("UI/Tooltip" + resourceName));
            }
        }