Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
- using System;
- using System.Collections.Generic;
- using UnityEngine;
-
- namespace coa4u
- {
- public class CalcerDirection : CalcerVector
- {
- Actor selfActor;
- Actor targetActor;
- Transform selfTransform;
- Transform targetTransform;
-
- public CalcerDirection(Actor self, Actor target)
- : base()
- {
- selfActor = self;
- targetActor = target;
- }
-
- public CalcerDirection(Transform self, Transform target)
- : base()
- {
- selfTransform = self;
- targetTransform = target;
- }
-
- public override Vector3 value
- {
- get
- {
- if (targetTransform != null)
- {
- return Quaternion.LookRotation(targetTransform.position - selfTransform.position).eulerAngles;
- }
- else
- {
- return Quaternion.LookRotation(targetActor.transformCached.position - selfActor.transformCached.position).eulerAngles;
- }
- }
-
- }
- }
- }
|