Beispiel #1
0
    protected void StartSpellBar(Vector3 pos, float duration, GameObject obj)
    {
        SharedGameObjectInfo info   = LogicSystem.GetSharedGameObjectInfo(obj);
        GameObject           uiRoot = GameObject.FindGameObjectWithTag("UI");

        if (null != uiRoot && null != info)
        {
            DFMUiRoot uiMgr = uiRoot.GetComponent <DFMUiRoot>();
            if (null != uiMgr)
            {
                uiMgr.ShowMonsterPrePower(pos.x, pos.y, pos.z, duration, info.m_LogicObjectId);
            }
        }
    }
Beispiel #2
0
    protected void StopSpell(GameObject obj)
    {
        SharedGameObjectInfo info   = LogicSystem.GetSharedGameObjectInfo(obj);
        GameObject           uiRoot = GameObject.FindGameObjectWithTag("UI");

        if (null != uiRoot && null != info)
        {
            DFMUiRoot uiMgr = uiRoot.GetComponent <DFMUiRoot>();
            if (null != uiMgr)
            {
                uiMgr.BreakPrePower(info.m_LogicObjectId);
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        m_SkillMovement = gameObject.GetComponent <SkillMovement>();
        if (m_SkillTipPrefab != null)
        {
            m_SkillTipObj = Instantiate(m_SkillTipPrefab, Vector3.zero, Quaternion.identity) as GameObject;
            m_SkillTipObj.SetActive(false);
        }
        else
        {
            Debug.Log("---sn: can't create skill notice obj!!");
        }

        CollectSkillScrip(m_Skills);
        m_ShooterSkillController = new ShooterControlHandler(this, m_Skills);
        m_ShooterSkillController.Init();
        ///
        TouchManager.OnGestureEvent += OnGestureEvent;

        GameObject tUiRoot = GameObject.FindGameObjectWithTag("UI");

        if (tUiRoot != null)
        {
            m_UIRoot = tUiRoot.GetComponent <DFMUiRoot>();
        }
        if (m_JoyStick != null)
        {
            m_JoyStickObj = GameObject.Instantiate(m_JoyStick) as GameObject;
            if (m_JoyStickObj != null)
            {
                m_JoyStickObj.transform.position = Vector3.zero;
                EasyJoystick joyStickScript = m_JoyStickObj.GetComponentInChildren <EasyJoystick>();
                if (joyStickScript != null)
                {
                    joyStickScript.JoystickPositionOffset = new Vector2(
                        m_JoyStickPosPercent.x * Screen.width,
                        m_JoyStickPosPercent.y * Screen.height);
                }
            }
        }
        //ShowChangWeaponButton();
        HideJoyStick();
    }