Exemple #1
0
 void OnEnable()
 {
     if (iconType != MiniMapElementIconType.Empty)
     {
         MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Create, id, iconType);
     }
 }
Exemple #2
0
 void LateUpdate()
 {
     if (MiniMapView.Instance.elementIconDict.ContainsKey(id) && lastPostion != transform.position)
     {
         lastPostion = transform.position;
         MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Update, id, transform.position);
     }
 }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            GameObject go = Instantiate(soldierGo) as GameObject;
            go.transform.parent        = goParent;
            go.transform.localPosition = new Vector3(Random.Range(-15, 15), 0, Random.Range(-15, 15));
            lastGo = go;
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            GameObject go = Instantiate(towerGo) as GameObject;
            go.transform.parent        = goParent;
            go.transform.localPosition = new Vector3(Random.Range(-15, 15), 0, Random.Range(-15, 15));
            lastGo = go;
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            effectId = MiniMapController.MakeId();
            MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Create, effectId, MiniMapElementIconType.Effect1);
            MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Update, effectId, lastGo.transform.position);
            b = true;
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Destroy, effectId);
            effectId = 0;
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Update, effectId, MiniMapElementIconType.Effect2);
        }

        if (Input.GetKeyDown(KeyCode.U))
        {
            lastGo.GetComponent <MiniMapElement>().enabled = !lastGo.GetComponent <MiniMapElement>().enabled;
        }
    }
Exemple #4
0
 void OnDisable()
 {
     lastPostion = Vector2.zero;
     MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Destroy, id, MiniMapView.Instance.controller.elementDataDict[id]);
 }
Exemple #5
0
 public void UpdateIcon(MiniMapElementIconType iconType)
 {
     this.iconType = iconType;
     MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Update, id, iconType);
 }
Exemple #6
0
 public void Init(MiniMapElementIconType iconType)
 {
     id            = MiniMapController.MakeId();
     this.iconType = iconType;
     MiniMapMessageDispatcher.PostElementMessage(MiniMapElementStateType.Create, id, iconType);
 }