Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class NPC : MonoBehaviour {
- protected Rigidbody thisRigidbody;
- protected Collider thisCollider;
- protected Vector3 thisPosition
- {
- get
- {
- return this.gameObject.transform.position;
- }
- set
- {
- gameObject.transform.position = value;
- }
- }
- protected Quaternion thisRotation
- {
- get
- {
- return this.gameObject.transform.rotation;
- }
- set
- {
- gameObject.transform.rotation = value;
- }
- }
- protected Vector3 thisVelocity
- {
- get
- {
- return thisRigidbody.velocity;
- }
- set
- {
- thisRigidbody.velocity = value;
- }
- }
- protected Vector3 thisForwardVector
- {
- get
- {
- return this.gameObject.transform.forward;
- }
- }
- protected Vector3 thisRightVector
- {
- get
- {
- return this.gameObject.transform.right;
- }
- }
- protected DebugLogConsole debugLogConsole;
- // Use this for initialization
- protected void Start () {
- thisRigidbody = this.gameObject.GetComponent<Rigidbody>();
- thisCollider = this.gameObject.GetComponent<Collider>();
- debugLogConsole = GameObject.Find("master").GetComponent<masterScript>().debugLogConsole;
- }
- public void addVelocity(Vector3 vel)
- {
- thisVelocity += vel;
- }
- public void setVelocity(Vector3 vel)
- {
- thisVelocity = vel;
- }
- public void turn(float x = 90, float y = 0, float z = 0)
- {
- thisRotation *= Quaternion.Euler(x, y, z);
- }
- public void teleport(float x = 0, float y = 0, float z = 0)
- {
- thisPosition = new Vector3(x, y, z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement