1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class MapItem : MapObject
- {
- public const int BIGGER = 1;
- public Texture[] textureArr;
- public override void Init (Map map)
- {
- base.Init (map);
- }
- // public override TeamUtil.Team team {
- // get {
- // return base.team;
- // }
- // set {
- // base.team = value;
- // int index = value.GetHashCode() - 1;
- // Renderer[] renderers = this.GetComponentsInChildren<Renderer>();
- // for(int i=0; i<renderers.Length; i++)
- // {
- // renderers[i].material.mainTexture = textureArr[index];
- // }
- // }
- // }
- protected void OnTriggerEnter(Collider other)
- {
- Debuger.LogError (other.name);
- CraftAI ai = other.GetComponent<CraftAI> ();
- if(ai != null)
- {
- ai.AttempGetItem (this);
- }
- }
- public void SetPosition(Vector3 pos)
- {
- this.transform.position = pos;
- }
- public override void Remove ()
- {
- map.RemoveMapItem(this);
- Destroy(this.gameObject);
- }
- }
|