예제 #1
0
 // Use this for initialization
 void Awake()
 {
     _vehicle = GetComponent <AutonomousVehicle>();
     if (_vehicle == null)
     {
         Destroy(this);
         throw new  System.Exception("Missing vehicle, cannot continue");
     }
 }
 // Use this for initialization
 void Awake()
 {
     _vehicle = GetComponent<AutonomousVehicle>();
     if (_vehicle == null)
     {
         Destroy(this);
         throw new  System.Exception("Missing vehicle, cannot continue");
     }
 }
예제 #3
0
    //public Transform head;

    void Awake()
    {
        steerfortarget = gameObject.GetComponent <SteerForTarget>();
        vehicle        = this.gameObject.GetComponent <AutonomousVehicle>();
        person         = this.gameObject.GetComponent <Person>();
        aware          = this.gameObject.GetComponent <Aware>();
        personControl  = GameObject.Find("Game Controller").GetComponent <s_PersonControl>();
        me             = this.gameObject;
        sightdetect    = this.gameObject.GetComponentInChildren <SightDetect>();
        clicker        = GameObject.Find("Game Controller").GetComponent <s_Clicker>();
    }
예제 #4
0
        protected override void Initialize()
        {
            randomSteer = GetComponent<RandomnessSteerForPoint>();
            steerForPoint = GetComponent<SteerForPoint>();
            vehicle = GetComponent<AutonomousVehicle>();
            animator = GetComponentInChildren<Animator>();

            if(manager != null) {
            manager.pocketTracker.OnPocket += OnPocket;
            }
        }
예제 #5
0
        override protected void Initialize()
        {
            randomSteer   = GetComponent <RandomnessSteerForPoint>();
            steerForPoint = GetComponent <SteerForPoint>();
            vehicle       = GetComponent <AutonomousVehicle>();
            animator      = GetComponentInChildren <Animator>();

            if (manager != null)
            {
                manager.pocketTracker.OnPocket += OnPocket;
            }
        }
예제 #6
0
파일: Enemy.cs 프로젝트: kelvinRosa/Skrap
	void Start()
	{
		vehicle = GetComponent<AutonomousVehicle>();
		photonView = GetComponent<PhotonView>();
		//Sets itself up for networking
		if (!photonView.isMine)
		{
			//DisableAI();
		}

		health = _health;
		InitEnemy();
	}
예제 #7
0
 //public Transform head;
 void Awake()
 {
     steerfortarget = gameObject.GetComponent<SteerForTarget>();
     vehicle = this.gameObject.GetComponent<AutonomousVehicle>();
     person = this.gameObject.GetComponent<Person>();
     aware = this.gameObject.GetComponent<Aware>();
     personControl = GameObject.Find("Game Controller").GetComponent<s_PersonControl>();
     me = this.gameObject;
     sightdetect = this.gameObject.GetComponentInChildren<SightDetect>();
     clicker = GameObject.Find("Game Controller").GetComponent<s_Clicker>();
 }
예제 #8
0
    public void ChangeSize(float percent)
    {
        Vehicle = GetComponent<AutonomousVehicle>();
        Vehicle.MaxSpeed *= 1 + percent;				// bigger size, faster max speed
        Vehicle.TurnTime *= 1 - (2 * percent);			// bigger size, slower turn time
        Vehicle.Transform.localScale *= 1 - (2 * percent);	// change local scale
        Vehicle.ScaleRadiusWithTransform(_originalRadius);	// scale original radius

        OriginalSpeed = Vehicle.MaxSpeed;
        OriginalTurnTime = Vehicle.TurnTime;
    }