예제 #1
0
 private void Start()
 {
     inst_Character = CharacterManager.getInstance();
     MinimapCamera  = inst_Character.GetComponent <Transform>().Find("MinimapCamera").GetComponent <Camera>();
     UpdateMinimapScale();
     inst_Minimap = MinimapManager.getInstance();
 }
예제 #2
0
    static private Vector3 CalcMouseDirectionInWorldSpace()
    {
        if (inst_character == null)
        {
            inst_character = CharacterManager.getInstance();
        }
        if (inst_minimap == null)
        {
            inst_minimap = MinimapManager.getInstance();
        }
        Vector3 clippedPos = Input.mousePosition;

        clippedPos.x = Mathf.Clamp(clippedPos.x, 0, Screen.width);
        clippedPos.y = Mathf.Clamp(clippedPos.y, 0, Screen.height);

        Ray ray = Camera.main.ScreenPointToRay(clippedPos);

        RaycastHit hit;
        int        mask = 1 << inst_minimap.layerMask;

        if (Physics.Raycast(ray, out hit, float.MaxValue, mask))
        {
            return((hit.point - inst_character.transform.position).normalized);
        }

        //이 아래줄은 실행되면 안 됨. 스킬은 어떤 경우에서도 나가야하므로.
        return(Vector3.zero);
    }
예제 #3
0
    protected override void Initialize()
    {
        base.Initialize();

        if (!this.Fallen)
        {
            MinimapManager.AddMinimapObject(this);
        }
    }
 protected override void Initialize()
 {
     base.Initialize();
     this.UpdateGrowthOccupancy();
     if (!this.Fallen)
     {
         MinimapManager.AddMinimapObject(this);
     }
 }
예제 #5
0
 void Awake()
 {
     scale = defaultScale;
     if (_instance == null)
     {
         _instance = FindObjectOfType <MinimapManager>();
     }
     guideCamera = GameObject.Find("Guide Camera").GetComponent <Camera>();
 }
예제 #6
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #7
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     if (instance != this)
     {
         DestroyImmediate(this);
     }
     DontDestroyOnLoad(this);
 }
    protected override void Initialize()
    {
        base.Initialize();

        // Fill in occupancy (CurrentThreshold shouldn't get serialized so this will fill the whole tree)
        this.GrowthPercent = this.growthPercent;

        if (!this.Fallen)
        {
            MinimapManager.AddMinimapObject(this);
        }
    }
예제 #9
0
 void OnMouseOver()
 {
     if (Input.GetAxis("Mouse ScrollWheel") > 0)
     {
         MinimapManager.SetScale(+5, true);
         clock = Time.time;
     }
     else if (Input.GetAxis("Mouse ScrollWheel") < 0)
     {
         MinimapManager.SetScale(-5, true);
         clock = Time.time;
     }
 }
예제 #10
0
    void Awake()
    {
        try {
            LoadMap();
        } catch (System.Exception e) {
            Debug.Log("Failed to load map. regenerating: " + e);
            RegenerateMap();
        }
        world = new Game.World(map, navi);
        world.eventListener = this;

        worldManager = GetComponent <WorldManager>();
        var mm_go = Instantiate(minimapPrefab);

        mm_go.transform.SetParent(minimapContainer, false);
        minimapManager     = mm_go.GetComponent <MinimapManager>();
        minimapManager.map = map;
    }
    public override void Destroy()
    {
        var treeBlockCheck = this.Position.Round;

        for (int i = 0; i <= GrowthThresholds.Length; i++)
        {
            var block = World.GetBlock(treeBlockCheck);
            if (block.GetType() == this.Species.BlockType)
            {
                World.DeleteBlock(treeBlockCheck);
            }
            if (block.Is <Solid>())
            {
                break;
            }
            treeBlockCheck += Vector3i.Up;
        }
        MinimapManager.RemoveMinimapObject(this);
        base.Destroy();
    }
 void Awake()
 {
     currentInstance = this;
 }
예제 #13
0
 void Start()
 {
     inst_minimap = MinimapManager.getInstance();
 }
예제 #14
0
 void OnApplicationQuit()
 {
     Instance = null;
 }
예제 #15
0
 public void SetUp(int xPos, int yPos)
 {
     this.pieceMapX = xPos;
     this.pieceMapY = yPos;
     minimapManager = GameObject.Find(Constants.GAMEOBJECT_MINIMAP).GetComponent <MinimapManager>();
 }
예제 #16
0
 void Awake()
 {
     Instance = this;
     player   = GameObject.FindGameObjectWithTag("Player").transform;
 }
예제 #17
0
 // Use this for initialization
 void Start()
 {
     man = MinimapManager.Instance;
 }