예제 #1
0
        public override void ExternalAction(ReoGridControl grid, SpreadsheetEditorNode node)
        {
            base.ExternalAction(grid, node);

            var worksheet = string.IsNullOrWhiteSpace(WorksheetName)
                ? grid.CurrentWorksheet
                : grid.Worksheets[WorksheetName];

            if (Add)
            {
                worksheet.IterateCells(Range, (r, c, cell) =>
                {
                    worksheet[r, c] = new ProgressCell
                    {
                        BottomColor = new SolidColor(100, 100, 100),
                        TopColor    = new SolidColor(80, 80, 80)
                    };
                    return(true);
                });
            }

            if (Remove)
            {
                worksheet.IterateCells(Range, (r, c, cell) =>
                {
                    worksheet[r, c] = new CellBody();
                    return(true);
                });
            }
        }
예제 #2
0
 public void SyphonTarget(CellBody target)
 {
     if (!_syphoning)
     {
         _syphoning = true;
         syphon     = StartCoroutine(SyphonResources(syphVal, syphPerS, 1, target));
     }
 }
예제 #3
0
 // Use this for initialization
 void Awake()
 {
     _cellAgent         = GetComponent <NavMeshAgent>();
     _cellRB            = GetComponent <Rigidbody>();
     _cellBody          = GetComponent <CellBody>();
     _cellAgent.enabled = false;
     _reachedDest       = true;
 }
예제 #4
0
        public void SetCellBodyFromXml(Worksheet sheet, XElement cellel, CellBody body)
        {
            var rc = ParseRowCol(cellel);

            if (rc.r < 0 || rc.c < 0)
            {
                return;
            }
            sheet.Cells[rc.r, rc.c].Body = body;
        }
예제 #5
0
 /// <summary>
 /// worksheet_CellMouseDown事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void worksheet_CellMouseDown(object sender, CellMouseEventArgs e)
 {
     if (row == 0)
     {
         worksheet.SetSettings(WorksheetSettings.Edit_Readonly, true);
     }
     else
     {
         if (e.CellPosition.Row < row)
         {
             worksheet.SetSettings(WorksheetSettings.Edit_Readonly, false);
             //contentsList();
             string bookname = txbCe.Text.Substring(0, txbCe.Text.LastIndexOf("_"));
             if (cell != string.Empty)
             {
                 if (cellnum >= 1)
                 {
                     worksheet[cell] = new CellBody();
                 }
                 //worksheet.SelectionMode = WorksheetSelectionMode.Cell;
             }
             cellnum = e.CellPosition.Col;
             cell    = e.CellPosition.ToString();
             #region
             if (e.CellPosition.Col == 4) //D
             {
                 worksheet[e.CellPosition] = new DropdownListCell(resultRSORTList.ToArray());
             }
             if (e.CellPosition.Col == 6) //F
             {
                 worksheet[e.CellPosition] = new DropdownListCell(catologList.ToArray());
             }
             if (e.CellPosition.Col == 11)//K
             {
                 worksheet[e.CellPosition] = new DropdownListCell(banquanMirror.Values.ToArray());
             }
             if (e.CellPosition.Col == 12)//L
             {
                 worksheet[e.CellPosition] = new DropdownListCell(resultZYDLList.ToArray());
             }
             #endregion
         }
         else
         {
             worksheet.SetSettings(WorksheetSettings.Edit_Readonly, true);
         }
     }
 }
예제 #6
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag != Tags.playerTag && other.gameObject.tag != Tags.flowAreaTag)
     {
         if (other.gameObject.tag == Tags.whiteCellTag || other.gameObject.tag == Tags.redCellTag || other.gameObject.tag == Tags.virusCellTag || other.gameObject.tag == Tags.bossTag)
         {
             CellBody cb = other.gameObject.GetComponent <CellBody>();
             cb.TakeDamage(_damage);
             Destroy(gameObject);
         }
         else
         {
             Destroy(gameObject);
         }
     }
 }
예제 #7
0
    public void OnCollisionEnter(Collision collision)
    {
        Rigidbody targetRB = null;
        CellBody  target   = null;
        Chasis    player   = null;

        if (collision.gameObject.tag != Tags.playerTag)
        {
            Collider[] targets = Physics.OverlapSphere(transform.position, _explosionRadius);
            for (int i = 0; i < targets.Length; i++)
            {
                if (targets[i].gameObject.tag == Tags.playerTag)
                {
                    player = targets[i].GetComponent <Chasis>();
                }
                else
                {
                    target = targets[i].GetComponent <CellBody>();
                }


                targetRB = targets[i].GetComponent <Rigidbody>();

                if (targetRB != null)
                {
                    targetRB.AddExplosionForce(_explosionForce, transform.position, _explosionRadius, 0, ForceMode.Impulse);
                    Debug.Log("EXPLODE");

                    if (target != null)
                    {
                        target.TakeDamage(_dmg);
                    }

                    if (player != null)
                    {
                        player.TakeDamage(_dmg);
                    }
                }


                Destroy(gameObject);
            }
        }
    }
예제 #8
0
    void Detonate()
    {
        Rigidbody targetRB = null;
        CellBody  target   = null;
        Chasis    player   = null;

        Collider[] targets = Physics.OverlapSphere(transform.position, _explosionRadius);

        for (int i = 0; i < targets.Length; i++)
        {
            if (targets[i].gameObject.tag == Tags.playerTag)
            {
                player = targets[i].GetComponent <Chasis>();
            }
            else
            {
                target = targets[i].GetComponent <CellBody>();
            }


            targetRB = targets[i].GetComponent <Rigidbody>();

            if (targetRB != null && targetRB != _rb)
            {
                targetRB.AddExplosionForce(_explosionForce, transform.position, _explosionRadius, 0, ForceMode.Impulse);

                if (target != null)
                {
                    target.TakeDamage(_mineDamage);
                }

                if (player != null)
                {
                    player.TakeDamage(_mineDamage);
                    Debug.Log(player.gameObject.name);
                }
            }


            Destroy(gameObject);
        }
    }
예제 #9
0
 void OnCollisionEnter(Collision collision)
 {
     Debug.Log(collision.gameObject.tag);
     if (collision.gameObject.tag != Tags.playerTag && collision.gameObject.tag != Tags.bossTag)
     {
         _hasTarget = true;
         Debug.Log("Hook HIT"); // if you hit a wall or something that you can attach to
         if (collision.gameObject.tag == Tags.wallTag)
         {
             _cTarget              = collision.gameObject;
             _rb.isKinematic       = true;
             _spring               = gameObject.AddComponent <SpringJoint>();
             _spring.axis          = transform.forward;
             _spring.minDistance   = 0.05f;
             _spring.maxDistance   = 0.10f;
             _spring.connectedBody = _playerRB;
         }
         else if (collision.gameObject.tag == Tags.redCellTag || collision.gameObject.tag == Tags.whiteCellTag || collision.gameObject.tag == Tags.virusCellTag)
         {
             _isCell  = true;
             _cTarget = collision.gameObject;
             _cb      = _cTarget.GetComponent <CellBody>();
             RaycastHit hit;
             if (Physics.Raycast(transform.position, transform.forward, out hit))
             {
                 gameObject.transform.position = hit.point;
                 Destroy(_rb);
                 gameObject.transform.SetParent(collision.gameObject.transform);
                 _spring               = _cTarget.gameObject.AddComponent <SpringJoint>();
                 _spring.axis          = transform.forward;
                 _spring.minDistance   = 0.05f;
                 _spring.maxDistance   = 0.10f;
                 _spring.connectedBody = _playerRB;
             }
         }
     }
 }
예제 #10
0
    //Syphon function ---- needs special syphonable objects class
    IEnumerator SyphonResources(int synthesis, int sPerSecond, double rarityMod, CellBody syphTarget)
    {
        double tSynth  = synthesis * rarityMod;
        double tPerSec = sPerSecond * rarityMod;

        //initial threat --- assaulting the cell

        while (tSynth > 0)
        {
            yield return(_waitforS);

            if (!syphTarget.isDead())
            {
                if (tSynth >= tPerSec)
                {
                    tSynth -= tPerSec;
                    syphTarget.TakeSynthDamage(tPerSec);
                    _synthesis += sPerSecond;
                }
                else
                {
                    tSynth -= tPerSec + (tSynth - tPerSec);
                    syphTarget.TakeSynthDamage(tPerSec + (tSynth - tPerSec));
                    _synthesis += tPerSec + (tSynth - tPerSec);
                }
            }
            else
            {
                _syphoning = false;
                // -- threat - has killed the cell
                yield break;
            }
        }

        _syphoning = false;
    }