示例#1
0
 public void BeginGroupFill(FoE side)
 {
     if (this.GoodOrEvil != side)
     {
         ResetGroup();
     }
     GroupState = GROUPSTATE.UnderConstruction;
     GoodOrEvil = side;
 }
示例#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);
     }
 }
示例#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);
        }
    }
示例#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;
 }
示例#6
0
 public FoE(FoE a, FoE b)
 {
     FE = a.FE + b.FE;
     FE = (byte)this;
 }
示例#7
0
 public void SetShooter(GameObject unit)
 {
     //   UNIT = unit.GetComponent<UnitScript>();
     GoodOrEvil = unit.GetComponent <UnitScript>().GoodOrEvil;
 }
示例#8
0
 public FoE(FoE fe)
 {
     FE = fe.FE;
 }
示例#9
0
 public void BeginGroupFill(FoE side)
 {
     if (this.GoodOrEvil != side)
         ResetGroup();
     GroupState = GROUPSTATE.UnderConstruction;
     GoodOrEvil = side;
 }
示例#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);
     }
 }
示例#11
0
 public FoE(FoE a, FoE b)
 {
     FE = a.FE + b.FE;
     FE = (byte)this;
 }
示例#12
0
 public FoE(FoE fe)
 {
     FE = fe.FE;
 }
示例#13
0
 public bool IsEnemy(FoE other)
 {
     return this.GoodOrEvil+other;
 }
示例#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);
	    }
	}
示例#15
0
 public void SetTarget(Vector3 targetPosition, FoE.GOODorEVIL foe)
 {
     Target = targetPosition;
     this.GoodOrEvil = new FoE(foe);
 }