public void Init(Action <MemoryStream> _sendDataCallBack)
    {
        Log.Init(WriteLog);

        SuperRaycast.SetCamera(mainCamera);

        SuperRaycast.SetIsOpen(true, "a");

        SuperRaycast.checkBlockByUi = true;

        Dictionary <int, HeroSDS> heroDic = StaticData.GetDic <HeroSDS> ();

        Dictionary <int, SkillSDS> skillDic = StaticData.GetDic <SkillSDS> ();

        Dictionary <int, AuraSDS> auraDic = StaticData.GetDic <AuraSDS> ();

        Battle.Init(Map.mapDataDic, heroDic, skillDic, auraDic);

        battle = new Battle();

        battle.ClientSetCallBack(_sendDataCallBack, RefreshData, DoAction, BattleQuit);

        SuperFunction.Instance.AddEventListener(ScreenScale.Instance.go, ScreenScale.SCALE_CHANGE, ScaleChange);

        SuperFunction.Instance.AddEventListener(backGround, SuperRaycast.GetMouseButtonDown, GetMouseDown);

        SuperFunction.Instance.AddEventListener(backGround, SuperRaycast.GetMouseButton, GetMouseMove);

//		SuperFunction.Instance.AddEventListener (backGround, SuperRaycast.GetMouseButtonUp, GetMouseUp);
    }
示例#2
0
    public void Close()
    {
        gameObject.SetActive(false);

        SuperGraphicRaycast.SetIsOpen(true, "a");

        SuperRaycast.SetIsOpen(true, "a");

        if (callBack != null)
        {
            callBack();
        }
    }
示例#3
0
    //----

    public void Init(Action <MemoryStream> _sendDataCallBack, Action _overCallBack)
    {
        battle = new Battle();

        overCallBack = _overCallBack;

        battle.ClientInit(_sendDataCallBack, Refresh, SendCommandOK, BattleOver);

        SuperRaycast.SetIsOpen(true, "1");

        SuperRaycast.checkBlockByUi = true;

        SuperRaycast.SetCamera(battleCamera);

        Dictionary <int, UnitSDS> tmpDic = StaticData.GetDic <UnitSDS> ();

        Dictionary <int, UnitSDS> .ValueCollection.Enumerator enumerator = tmpDic.Values.GetEnumerator();

        while (enumerator.MoveNext())
        {
            UnitSDS sds = enumerator.Current;

            if (sds.isHero)
            {
                HeroCellData cellData = new HeroCellData(sds.ID, false, 0, true);

                heroList.Add(cellData);

                heroDic.Add(sds.ID, cellData);
            }
            else
            {
                UnitCellData cellData = new UnitCellData(sds.ID, 0);

                unitList.Add(cellData);

                unitDic.Add(sds.ID, cellData);
            }
        }

        unitSuperList.SetData(unitList);

        heroSuperList.SetData(heroList);

        unitSuperList.CellClickHandle = UnitCellClick;

        gameObject.SetActive(false);

        SuperFunction.Instance.AddEventListener <RaycastHit, int> (quad, SuperRaycast.GetMouseClick, QuadClick);
    }
示例#4
0
    public void Alert(string _str, Action _callBack)
    {
        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);

            SuperGraphicRaycast.SetIsOpen(false, "a");

            SuperRaycast.SetIsOpen(false, "a");
        }

        callBack = _callBack;

        alertText.text = _str;
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        battleServer = new Battle();

        battleServer.ServerInit(ServerSendData);

        battleServer.ServerStart();

        Action <MemoryStream> dele = delegate(MemoryStream obj) {
            ClientSendData(true, obj);
        };

        battleManager1.Init(dele, BattleOver);

        battleManager1.BattleStart();

        dele = delegate(MemoryStream obj) {
            ClientSendData(false, obj);
        };

        SuperRaycast.SetIsOpen(false, "");

        battleManager2.Init(dele, BattleOver);

        battleManager2.BattleStart();

        SuperRaycast.SetCamera(battleCamera1);

        battleCamera2.gameObject.SetActive(false);

        battleUI2.SetActive(false);

        battleServer.ServerRefresh(true);

        battleServer.ServerRefresh(false);

        isStart = true;
    }
    private void RefreshTouchable(bool _canAction)
    {
        if (canAction && !_canAction)
        {
            SuperGraphicRaycast.SetIsOpen(false, "a");

            SuperRaycast.SetIsOpen(false, "a");

            actionBt.SetActive(false);

            canAction = _canAction;
        }
        else if (!canAction && _canAction)
        {
            SuperGraphicRaycast.SetIsOpen(true, "a");

            SuperRaycast.SetIsOpen(true, "a");

            actionBt.SetActive(true);

            canAction = _canAction;
        }
    }
示例#7
0
    void Awake()
    {
        SuperRaycast.SetCamera(Camera.main);

        SuperRaycast.SetIsOpen(true, "a");
    }
示例#8
0
        public void OpenRaycast()
        {
            SuperGraphicRaycast.SetIsOpen(true, "RaycastControlScript-OpenRaycast");

            SuperRaycast.SetIsOpen(true, "RaycastControlScript-OpenRaycast");
        }
示例#9
0
        public void CloseRaycast()
        {
            SuperGraphicRaycast.SetIsOpen(false, "RaycastControlScript-CloseRaycast");

            SuperRaycast.SetIsOpen(false, "RaycastControlScript-CloseRaycast");
        }