コード例 #1
0
ファイル: EntityMarker.cs プロジェクト: cnavas88/ES2015A
    // Update is called once per frame
    protected virtual void Update()
    {
        if (tot_timer >= REFRESH_TIME)
        {
            if (box_text == null)
            {
                box_text = MinimapOverlays.CreateTextureUnit(getRaceColor(gameObject.GetComponent <IGameEntity>().info.race));
            }
            marker_rect = MinimapOverlays.CalculateBoxFromCntr(this.transform.position, mainCam, 1);

            underAttack_rect = MinimapOverlays.CalculateBoxFromCntr(this.transform.position, mainCam, 10);
            tot_timer        = 0f;
        }
        else
        {
            tot_timer += Time.deltaTime;
        }

        if (creation_ON)
        {
            if (!hasAnimationEnd(ref creation_timer, ANIMATION_TIME, ref creation_ON))
            {
                creation_ind = getIndex(creation_timer, ANIMATION_TIME);
            }
        }

        if (underAttack_ON)
        {
            if (!hasAnimationEnd(ref underAttack_timer, ANIMATION_TIME, ref underAttack_ON))
            {
                underAttack_ind = getIndex(underAttack_timer, ANIMATION_TIME);
            }
        }
        if (isOnSight)
        {
            if (!hasAnimationEnd(ref onSightTimer, ANIMATION_TIME, ref isOnSight))
            {
                onSightIdx = getIndex(onSightTimer, ANIMATION_TIME);
            }
        }
    }
コード例 #2
0
ファイル: EntityMarker.cs プロジェクト: cnavas88/ES2015A
 private void showOnSight(int index)
 {
     onSightRect = MinimapOverlays.CalculateBoxFromCntr(transform.position, mainCam, (int)((5f * 3f) / (index + 1)));
     GUI.DrawTexture(onSightRect, onSightTexture);
 }
コード例 #3
0
ファイル: EntityMarker.cs プロジェクト: cnavas88/ES2015A
 private void showCreate(int index)
 {
     creation_rect = MinimapOverlays.CalculateBoxFromCntr(this.transform.position, mainCam, (int)((15f / (15f + 11f)) * (index + 1))); // 11f : hack to make less vig the texture raul_hack
     GUI.DrawTexture(creation_rect, creation_tex);
 }
コード例 #4
0
ファイル: EntityMarker.cs プロジェクト: cnavas88/ES2015A
 private void showAttack(int index)
 {
     underAttack_rect = MinimapOverlays.CalculateBoxFromCntr(this.transform.position, mainCam, (int)((13f * 3f) / (index + 1))); // 3f : hack to make less vig the texture raul_hack
     GUI.DrawTexture(underAttack_rect, underAttack_tex);
 }
コード例 #5
0
 /// <summary>
 /// This method initialize and sets up the Maerker.
 /// </summary>
 private void createMarker()
 {
     rect_marker = getCameraRect();
     tex         = MinimapOverlays.CreateTextureMarker(Color.white);
 }