コード例 #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
ファイル: TreeObject.cs プロジェクト: Talindor2/eco_mod
    protected override void Initialize()
    {
        base.Initialize();

        if (!this.Fallen)
        {
            MinimapManager.AddMinimapObject(this);
        }
    }
コード例 #4
0
 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);
 }
コード例 #8
0
    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;
    }
コード例 #11
0
    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();
    }
コード例 #12
0
 void Awake()
 {
     currentInstance = this;
 }
コード例 #13
0
 void Start()
 {
     inst_minimap = MinimapManager.getInstance();
 }
コード例 #14
0
ファイル: MinimapManager.cs プロジェクト: KirbyXcode/MiniMap
 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
ファイル: MinimapManager.cs プロジェクト: KirbyXcode/MiniMap
 void Awake()
 {
     Instance = this;
     player   = GameObject.FindGameObjectWithTag("Player").transform;
 }
コード例 #17
0
 // Use this for initialization
 void Start()
 {
     man = MinimapManager.Instance;
 }