Example #1
0
    public override void Initial()
    {
        coolDownSprite = gameObject.GetComponentInChildren <PackedSprite>();
        if (coolDownSprite == null)
        {
            UnityEngine.Object cooldown = UIWindowMng.Instance.GetObjFromCommon("Cooldown");
            if (cooldown != null)
            {
                GameObject cooldownGo = UnityEngine.Object.Instantiate(cooldown,
                                                                       Vector3.zero, new Quaternion(0, 0, 0, 0)) as GameObject;
                cooldownGo.transform.parent        = gameObject.transform;
                cooldownGo.transform.localPosition = new Vector3(0, 0, -0.1f);
                coolDownSprite = cooldownGo.GetComponent <PackedSprite>();
            }
            else
            {
                LogManager.LogError("Can not found Cooldown Prefab.");
                return;
            }
        }

        coolDownSprite.SetAnimCompleteDelegate(AnimEndDelegate);
        coolDownSprite.RenderCamera = UISystem.Instance.UiCamrea;

        if (ezButton != null)
        {
            ezButton.AddInputDelegate(DragDelegate);
        }
        CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_SHORTKEY, ShortKeyClick);

        ClearAction();
    }
Example #2
0
    public void Start()
    {
        smokeEftGameObject = Instantiate(smokeEftPrb) as GameObject;

        smokeEftGameObject.transform.parent = transform;
        smokeEftGameObject.transform.localPosition = new Vector3(0, 1.07f, 0);

        attackEftGameObject = Instantiate(attackEftPrb) as GameObject;

        attackEftGameObject.transform.parent = transform;
        attackEftGameObject.transform.localPosition = new Vector3(0, 0.8f, 0);
        attackEftGameObject.SetActive(false);

        smokeEftPackedSprite = smokeEftGameObject.GetComponent<PackedSprite>();
        smokeEftPackedSprite.PlayAnim(0);

        attackEftPackedSprite = attackEftGameObject.GetComponent<PackedSprite>();

        attackEftPackedSprite.SetAnimCompleteDelegate(atkFinish);
    }