コード例 #1
0
    public void Update()
    {
        MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

        if (theMinimapSys == null)
        {
            return;
        }
        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

        if (hostPlayer == null || !hostPlayer.Captain)
        {
            return;
        }
        Vector3 vector = (Vector3)hostPlayer.Captain.handle.location;

        this.m_bPosDirty = (this.m_pos != vector);
        if (theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini)
        {
            if (this.m_bPosDirty)
            {
                this.UpdatePosition(this.mini_normalImgNode, ref vector, true);
                this.UpdatePosition(this.mini_redImgNode, ref vector, true);
                this.m_pos = vector;
            }
        }
        else if (theMinimapSys.CurMapType() == MinimapSys.EMapType.Big && this.m_bPosDirty)
        {
            this.UpdatePosition(this.big_normalImgNode, ref vector, false);
            this.UpdatePosition(this.big_redImgNode, ref vector, false);
            this.m_pos = vector;
        }
    }
コード例 #2
0
    public void Update(ref Vector2 dir)
    {
        if (dir == Vector2.zero)
        {
            return;
        }
        MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

        if (theMinimapSys == null)
        {
            return;
        }
        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

        if (hostPlayer == null || !hostPlayer.Captain)
        {
            return;
        }
        this.m_bDirDirty = (this.m_dir != dir);
        Vector3 vector = (Vector3)hostPlayer.Captain.handle.location;

        this.m_bPosDirty = (this.m_pos != vector);
        bool bSmallMap = theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

        if (this.m_bDirDirty)
        {
            this.UpdateRotation(this.mini_normalImgNode, ref dir);
            this.UpdateRotation(this.mini_redImgNode, ref dir);
            this.UpdateRotation(this.big_normalImgNode, ref dir);
            this.UpdateRotation(this.big_redImgNode, ref dir);
            this.m_dir = dir;
        }
        if (this.m_bPosDirty)
        {
            this.UpdatePosition(this.mini_normalImgNode, ref vector, bSmallMap);
            this.UpdatePosition(this.mini_redImgNode, ref vector, bSmallMap);
            this.UpdatePosition(this.big_normalImgNode, ref vector, bSmallMap);
            this.UpdatePosition(this.big_redImgNode, ref vector, bSmallMap);
            this.m_pos = vector;
        }
    }