Example #1
0
 public void BeginGroupFill(FoE side)
 {
     if (this.GoodOrEvil != side)
     {
         ResetGroup();
     }
     GroupState = GROUPSTATE.UnderConstruction;
     GoodOrEvil = side;
 }
Example #2
0
 public void AddUnit(GameObject newUnit)
 {
     if (MemberUnit.Count == 0)
     {
         this.GoodOrEvil = newUnit.GetComponent <UnitScript>().GoodOrEvil;
         position        = newUnit.transform.position;
     }
     if (newUnit.GetComponent <UnitScript>().GoodOrEvil == this.GoodOrEvil)
     {
         MemberUnit.Add(newUnit);
     }
 }
Example #3
0
    //--- Startup and Main-functionality:
    //###############################################################################
    void Awake()
    {
        GoodOrEvil    = new FoE(goodOrEvil);
        LifebarScript = ScriptableObject.CreateInstance <Lifebar>();
        Options       = gameObject.GetComponent <UnitOptions>();
        if (!gameObject.GetComponentInChildren <UnitWeapon>())
        {
            weapon = gameObject.AddComponent <NoWeapon>();
        }
        else
        {
            weapon = gameObject.GetComponentInChildren <UnitWeapon>();
        }

        if (!IsABuilding && this.GoodOrEvil == FoE.GOODorEVIL.Good)
        {
            ResourceManager.AddResouce(ResourceManager.Resource.LABORER, 1);
        }
    }
Example #4
0
 public bool IsEnemy(FoE other)
 {
     return(this.GoodOrEvil + other);
 }
 public void SetShooter(GameObject unit)
 {
  //   UNIT = unit.GetComponent<UnitScript>();
     GoodOrEvil = unit.GetComponent<UnitScript>().GoodOrEvil;
 }
Example #6
0
 public FoE(FoE a, FoE b)
 {
     FE = a.FE + b.FE;
     FE = (byte)this;
 }
Example #7
0
 public void SetShooter(GameObject unit)
 {
     //   UNIT = unit.GetComponent<UnitScript>();
     GoodOrEvil = unit.GetComponent <UnitScript>().GoodOrEvil;
 }
Example #8
0
 public FoE(FoE fe)
 {
     FE = fe.FE;
 }
Example #9
0
 public void BeginGroupFill(FoE side)
 {
     if (this.GoodOrEvil != side)
         ResetGroup();
     GroupState = GROUPSTATE.UnderConstruction;
     GoodOrEvil = side;
 }
Example #10
0
 public void AddUnit(GameObject newUnit)
 {
     if (MemberUnit.Count == 0)
     {
         this.GoodOrEvil = newUnit.GetComponent<UnitScript>().GoodOrEvil;
         position = newUnit.transform.position;
     }
     if (newUnit.GetComponent<UnitScript>().GoodOrEvil == this.GoodOrEvil)
     {
         MemberUnit.Add(newUnit);
     }
 }
Example #11
0
 public FoE(FoE a, FoE b)
 {
     FE = a.FE + b.FE;
     FE = (byte)this;
 }
Example #12
0
 public FoE(FoE fe)
 {
     FE = fe.FE;
 }
Example #13
0
 public bool IsEnemy(FoE other)
 {
     return this.GoodOrEvil+other;
 }
Example #14
0
    //--- Startup and Main-functionality:
    //###############################################################################
	void Awake() 
    {
        GoodOrEvil = new FoE(goodOrEvil);
        LifebarScript = ScriptableObject.CreateInstance<Lifebar>();
        Options = gameObject.GetComponent<UnitOptions>();
        if (!gameObject.GetComponentInChildren<UnitWeapon>())
            weapon = gameObject.AddComponent<NoWeapon>();
        else
            weapon = gameObject.GetComponentInChildren<UnitWeapon>();

	    if (!IsABuilding && this.GoodOrEvil == FoE.GOODorEVIL.Good)
	    {
            ResourceManager.AddResouce(ResourceManager.Resource.LABORER, 1);
	    }
	}
Example #15
0
 public void SetTarget(Vector3 targetPosition, FoE.GOODorEVIL foe)
 {
     Target = targetPosition;
     this.GoodOrEvil = new FoE(foe);
 }