Ejemplo n.º 1
0
 private void Awake()
 {
     this.xform = base.transform;
     this.rbd = base.GetComponent<Rigidbody>();
     this.lookConstraint = base.GetComponent<SmoothLookAtConstraint>();
     this.projectile = base.GetComponent<Projectile>();
     this.projectile.AddOnLaunchedDelegate(new Projectile.OnLaunched(this.OnLaunched));
     this.projectile.AddOnLaunchedUpdateDelegate(new Projectile.OnLaunchedUpdate(this.OnLaunchedUpdate));
     this.projectile.AddOnDetonationDelegate(new Projectile.OnDetonation(this.OnDetonateProjectile));
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     this.xform          = base.transform;
     this.rbd            = base.GetComponent <Rigidbody>();
     this.lookConstraint = base.GetComponent <SmoothLookAtConstraint>();
     this.projectile     = base.GetComponent <Projectile>();
     this.projectile.AddOnLaunchedDelegate(new Projectile.OnLaunched(this.OnLaunched));
     this.projectile.AddOnLaunchedUpdateDelegate(new Projectile.OnLaunchedUpdate(this.OnLaunchedUpdate));
     this.projectile.AddOnDetonationDelegate(new Projectile.OnDetonation(this.OnDetonateProjectile));
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        this.xform = this.transform;
        this.rbd = this.rigidbody;
        this.lookConstraint = this.GetComponent<SmoothLookAtConstraint>();

        this.projectile = this.GetComponent<Projectile>();
        this.projectile.AddOnLaunchedDelegate(this.OnLaunched);
        this.projectile.AddOnLaunchedUpdateDelegate(this.OnLaunchedUpdate);
        this.projectile.AddOnDetonationDelegate(this.OnDetonateProjectile);
    }
    private void Awake()
    {
        this.xform          = this.transform;
        this.rbd            = this.rigidbody;
        this.lookConstraint = this.GetComponent <SmoothLookAtConstraint>();

        this.projectile = this.GetComponent <Projectile>();
        this.projectile.AddOnLaunchedDelegate(this.OnLaunched);
        this.projectile.AddOnLaunchedUpdateDelegate(this.OnLaunchedUpdate);
        this.projectile.AddOnDetonationDelegate(this.OnDetonateProjectile);
    }
Ejemplo n.º 5
0
 private void Awake()
 {
     this.xform    = base.transform;
     this.xformCns = base.gameObject.AddComponent <TransformConstraint>();
     this.xformCns.noTargetMode      = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
     this.xformCns.constrainRotation = false;
     this.lookCns = base.gameObject.AddComponent <SmoothLookAtConstraint>();
     this.lookCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
     this.lookCns.pointAxis    = Vector3.up;
     this.lookCns.upAxis       = Vector3.forward;
     this.lookCns.speed        = this.turnSpeed;
     base.StartCoroutine(this.LookAtRandom());
     base.StartCoroutine(this.MoveRandom());
 }
Ejemplo n.º 6
0
 private void Awake()
 {
     this.xform = base.transform;
     this.xformCns = base.gameObject.AddComponent<TransformConstraint>();
     this.xformCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
     this.xformCns.constrainRotation = false;
     this.lookCns = base.gameObject.AddComponent<SmoothLookAtConstraint>();
     this.lookCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
     this.lookCns.pointAxis = Vector3.up;
     this.lookCns.upAxis = Vector3.forward;
     this.lookCns.speed = this.turnSpeed;
     base.StartCoroutine(this.LookAtRandom());
     base.StartCoroutine(this.MoveRandom());
 }
Ejemplo n.º 7
0
    private void Awake()
    {
        this.xform = this.transform;  // Cache
    
        // Add a transform constraint
        this.xformCns = this.gameObject.AddComponent<TransformConstraint>();
        this.xformCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
        this.xformCns.constrainRotation = false;

        // Add a smooth lookAt constraint
        this.lookCns = this.gameObject.AddComponent<SmoothLookAtConstraint>();
        this.lookCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
        this.lookCns.pointAxis = Vector3.up;
        this.lookCns.upAxis = Vector3.forward;
        this.lookCns.speed = this.turnSpeed;

        // Start some co-routines to illustrate SetByScript
        this.StartCoroutine(this.LookAtRandom());
        this.StartCoroutine(this.MoveRandom());
    }
Ejemplo n.º 8
0
    private void Awake()
    {
        this.xform = this.transform;  // Cache

        // Add a transform constraint
        this.xformCns = this.gameObject.AddComponent <TransformConstraint>();
        this.xformCns.noTargetMode      = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
        this.xformCns.constrainRotation = false;

        // Add a smooth lookAt constraint
        this.lookCns = this.gameObject.AddComponent <SmoothLookAtConstraint>();
        this.lookCns.noTargetMode = UnityConstraints.NO_TARGET_OPTIONS.SetByScript;
        this.lookCns.pointAxis    = Vector3.up;
        this.lookCns.upAxis       = Vector3.forward;
        this.lookCns.speed        = this.turnSpeed;

        // Start some co-routines to illustrate SetByScript
        this.StartCoroutine(this.LookAtRandom());
        this.StartCoroutine(this.MoveRandom());
    }