Example #1
0
 // Use this for initialization
 void Start()
 {
     rbc = transform.parent.GetComponent<RBCScript>();
     float v = 2 * rbc.AntibodyCount() + 3;
     Vector3 scale = new Vector3(v,v,v);
     transform.localScale = scale;
 }
Example #2
0
 public RBCStateIdle(RBCScript rbc)
     : base(rbc)
 {
     rbc.IdleInit();
 }
Example #3
0
 public RBCStateExplode(RBCScript rbc)
     : base(rbc)
 {
     rbc.ExplodeInit();
 }
Example #4
0
 public RBCStateKill(RBCScript rbc)
     : base(rbc)
 {
     rbc.KillInit();
 }
Example #5
0
    IEnumerator Start()
    {
        rbc = (RBCScript)GetComponent<RBCScript>();
        tree = BLLib.InstantiateTree(BLLib.TreeType.Trees_RBC, this);

        while (Application.isPlaying && tree != null)
        {
            yield return new WaitForSeconds(0.0f);
            AIUpdate();
        }
    }
Example #6
0
 public RBCState(RBCScript rbc)
 {
     this.rbc = rbc;
 }
Example #7
0
    public void SetClosestTarget()
    {
        RBCScript closestRBC = null;

        foreach (RBCScript rbc in RBCList)
        {
            if (rbc.IsInfected())
            {
                if (closestRBC == null) {
                    closestRBC = rbc;
                    continue;
                }
                if (Vector3.Distance(closestRBC.transform.position, transform.position) > Vector3.Distance(rbc.transform.position, transform.position))
                {
                    closestRBC = rbc;
                }
            }
        }

        if (closestRBC != null)
        {
            target = closestRBC;
        } else {
            Debug.Log ("Uh oh, something bad happenszed! Report to cyber po-po");
        }
    }
Example #8
0
 public RBCStateInfected(RBCScript rbc)
     : base(rbc)
 {
     rbc.InfectedInit();
 }
Example #9
0
    public void SetClosestTarget()
    {
        GameObject train = transform.parent.gameObject;
        RBCScript[] rbcs = train.GetComponentsInChildren<RBCScript>();

        RBCList.Clear();
        foreach (RBCScript rbc in rbcs)
        {
            if (rbc.IsKilled() || rbc.IsInfected())
                continue;

            RBCList.Add(rbc);
        }

        RBCScript closestRBC = null;

        foreach (RBCScript rbc in RBCList)
        {
            if (closestRBC == null) {
                closestRBC = rbc;
                continue;
            }
            if (Vector3.Distance(closestRBC.transform.position, transform.position) > Vector3.Distance(rbc.transform.position, transform.position))
            {
                closestRBC = rbc;
            }

        }

        if (closestRBC != null)
        {
            target = closestRBC;
        } else {
            Debug.Log ("Uh oh, something bad happenszed! Report to cyber po-po");
        }
    }