protected override void Awake() { base.Awake(); ItemNeeded = "Beerbottle"; ikcontrol = GetComponentInChildren <IKControl>(); }
/// <summary> /// Start is called on the frame when a script is enabled just before /// any of the Update methods is called the first time. /// </summary> void Start() { winnerPID = ""; winnerAdrs = ""; winnerName = ""; _playfabUser = FindObjectOfType <PlayfabUser>(); Debug.Log(_playfabUser.Instance.Address + "\n" + _playfabUser.Instance.PrivateKey); /*EtherTransferCoroutinesUnityWebRequest eth = GameObject.FindGameObjectWithTag("ETH") * .GetComponent<EtherTransferCoroutinesUnityWebRequest>(); */ eth = FindObjectOfType <EtherTransferCoroutinesUnityWebRequest>(); fpController = GetComponent <FirstPersonController>(); ikControl = GetComponentInChildren <IKControl>(); damageImage = GameObject.FindGameObjectWithTag("Screen").transform.Find("DamageImage").GetComponent <Image>(); healthSlider = GameObject.FindGameObjectWithTag("Screen").GetComponentInChildren <Slider>(); currentHealth = startingHealth; if (photonView.IsMine) { gameObject.layer = LayerMask.NameToLayer("FPSPlayer"); healthSlider.value = currentHealth; } damaged = false; isDead = false; isSinking = false; }
public IKModelController(IModelDataManager mdm, IKControl ik) { modelDataManager = mdm; modelDataManager.SubscribeReceiver(this); AssignIKModel(ik); }
public override void OnInspectorGUI() { DrawDefaultInspector(); IKControl myScript = (IKControl)target; if (!myScript.isControlling) // only able to save rotations if you aren't animating { if (GUILayout.Button("Save rotations and start animation")) { myScript.SaveRotations(); } } if (GUILayout.Button("Return to original rotations")) { myScript.ReturnToRotations(true); //myScript.SaveRotations(); } if (GUILayout.Button("Stop animations and return to original rotations")) { myScript.isControlling = false; myScript.ReturnToRotations(true); } }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); ikContorl = GetComponent <IKControl>(); rightTrigger = rightHadukenTrigger.GetComponent <BoxCollider>(); leftTrigger = leftHadukenTrigger.GetComponent <BoxCollider>(); moves = new Move[moveFiles.Length]; for (int i = 0; i < moves.Length; i++) { moves[i] = new Move(); } /*for (int i = 0; i < moveFiles.Length; i++ ) * { * var hitboxes = importAttack(moveFiles[i]).hitboxes; * foreach (HitboxJS hbox in hitboxes) * { * //GameObject go = new GameObject(); * //go.AddComponent<MeshFilter>( * GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube); * go.transform.SetParent(transform); * Vector3 offset = floatVectorToVector(hbox.offset); * offset.Scale(transform.localScale); * go.transform.localPosition = offset; * go.transform.eulerAngles = floatVectorToVector(hbox.rotation); * Vector3 scale = floatVectorToVector(hbox.scale); * scale.Scale(transform.localScale); * go.transform.localScale = scale; * * } * }*/ for (int i = 0; i < moveFiles.Length; i++) { MoveJS move = importAttack(moveFiles[i]); var hitboxes = move.hitboxes; moves[i].hitboxes = new GhostHBox[hitboxes.Length]; moves[i].duration = move.duration; for (int j = 0; j < hitboxes.Length; j++) { Transform temp = Instantiate(prefab, new Vector3(0, 0, 0), Quaternion.identity); GhostHBox g = temp.GetComponent <GhostHBox>(); temp.SetParent(transform); temp.localScale = floatVectorToVector(hitboxes[j].scale); temp.localEulerAngles = floatVectorToVector(hitboxes[j].rotation); temp.localPosition = floatVectorToVector(hitboxes[j].offset); temp.name = hitboxes[j].name; g.beginFrame = hitboxes[j].beginFrame; g.duration = hitboxes[j].duration; g.damage = hitboxes[j].damage; g.hitStun = hitboxes[j].hitStun; g.launchVector = floatVectorToVector(hitboxes[j].launchVector); g.linearVelocity = floatVectorToVector(hitboxes[j].linearVelocity); g.angularVelocity = floatVectorToVector(hitboxes[j].angularVelocity); g.scaleVelocity = floatVectorToVector(hitboxes[j].scaleVelocity); moves[i].hitboxes[j] = g; } } }
protected void Init() { Debug.Log("Actor Awake()"); gunController = GetComponent <GunController>(); anim = GetComponent <Animator>(); gun = GetComponentInChildren <Gun>(); IK = GetComponent <IKControl>(); }
private void AssignIKModel(IKControl ikControl) { this.ikControl = ikControl; //if (this.ikControl == null) // return; //ikBody = this.ikControl.transform; }
public override bool Init(IKControl control, Transform p) { base.Init(control, p); v3bones = new Vector3[bdArr_data.Length - 1]; return(true); }
//public Image btnImage; //public Sprite onsprite, offsprite; private void Update() { if (Input.GetKeyDown(KeyCode.H)) { docIkControl = GameObject.FindGameObjectWithTag("LocalPlayer").transform.GetChild(0).GetComponent <IKControl>(); ExamineBreast(); } }
//Quaternion lastRotation; // Use this for initialization void Start() { noSamba = horns.outputAudioMixerGroup.audioMixer.FindSnapshot("NotSamba"); sambaSnap = horns.outputAudioMixerGroup.audioMixer.FindSnapshot("Samba"); anim = GetComponent <Animator>(); ikControl = GetComponent <IKControl>(); status = GetComponent <Status>(); multiDecayTimer = 1; }
private IKControl ReadIKControl() { var control = new IKControl(); control.Name = ReadString(20); control.Enabled = _reader.ReadBoolean(); return(control); }
private bool GetIK() { if (ikControl == null) { ikControl = FindObjectOfType <IKControl>(); } return(ikControl != null); }
private void CreateControls() { foreach (Transform effector in _effectors) { IKControl effectorUI = Instantiate(_ikControlTemplate, GetComponent <RectTransform>()); effectorUI.SetEffector(effector); _controls.Add(effectorUI); } }
private void Start() { Halo.enabled = false; gamePlayManager = FindObjectOfType <GamePlayManager>(); IKControlScript = GetComponentInParent <IKControl>(); studentAction = GetComponentInParent <StudentAction>(); playerCamera = Camera.main; updateStudentSelectedData = false; }
public SecondPassBase(IKControl parent) { PAM = parent; G = parent.IKCS; numBones = G.i_IKparents + 1; bd_data = new BoneData[numBones]; Setup(); }
private void Select() { foreach (IKControl control in _controls) { if (control.Rect.Contains(Input.mousePosition) && control.IsActive) { _selectedControl = control; control.Activate(); } } }
void Start() { stackColorCode = DataScript.currentColorCode; isFallingFinished = false; isFallingOnGround = false; height = 0; ikControl = GetComponentInParent <IKControl>(); collectedCubes = new List <Transform>(); gameMngr = FindObjectOfType(typeof(GameMngr)) as GameMngr; playerController = GetComponentInParent <PlayerController>(); }
private void AssignIKModel(IKControl ikControl) { this.ikControl = ikControl; //if (this.ikControl == null) // return; //ikBody = this.ikControl.transform; //if (this.ikControl.rightFootObj || this.ikControl.leftFootObj) // return; //ik.rightFootObj = rightFoot; //ik.leftFootObj = leftFoot; }
private void Awake() { navMeshAgent = GetComponentInChildren <NavMeshAgent>(); //navMeshAgent.updatePosition = false; navMeshAgent.updateRotation = false; navMeshAgent.updateUpAxis = false; movement = GetComponentInChildren <CharacterMovement>(); perlinYCoordinate = Random.Range(0, 100); iKControl = GetComponentInChildren <IKControl>(); StartCoroutine(KonfettiTimer()); }
public virtual void OnDrop(Transform player) { held = false; holdingPlayer = null; IKControl ik = player.GetComponentInChildren <IKControl>(); ik.ikActive = false; ik.leftHandObj = null; ik.rightHandObj = null; Destroy(gameObject.GetComponent <SpringJoint>()); }
private void GetComponents() { _jobManager = FindObjectOfType <JobManager>(); vitals = GetComponent <Vitals>(); aiVitals = GetComponent <AiVitals>(); fieldOfView = GetComponent <FieldOfView>(); inventory = GetComponentInChildren <GenericInventory>(); navAgent = GetComponent <NavMeshAgent>(); animator = GetComponent <Animator>(); weaponHolder = GetComponent <WeaponHolder>(); iKControl = GetComponent <IKControl>(); thirdPersonCharacter = GetComponent <ThirdPersonCharacter>(); }
//PlayerScore score; // Called when script awake in editor void Awake() { playerAudio = GetComponent <AudioSource>(); playerShooting = GetComponentInChildren <GunShooting>(); capsuleCollider = GetComponent <CapsuleCollider>(); fps = GetComponent <FirstPersonController>(); ikControl = GetComponentInChildren <IKControl>(); //score = GetComponent<PlayerScore>(); healthSlider = GameObject.FindGameObjectWithTag("Screen").GetComponentInChildren <Slider>(); damageImage = GameObject.FindGameObjectWithTag("Screen").transform.Find("DamageImage").GetComponent <Image>(); currentHealth = startingHealth; healthSlider.value = currentHealth; }
private void Deselect() { _selectedControl = null; foreach (IKControl control in _controls) { if (!control.IsActive) { continue; } control.Deactivate(); } }
// Use this for initialization void Start() { //playerHead = GameObject.FindGameObjectWithTag ("HelmetSlot"); audioSource = gameObject.GetComponent <AudioSource> (); ik = GetComponent <IKControl>(); anim = GetComponent <Animator>(); SetEquippedWeapon(null); aim = new GameObject(); Initilize(); equippedWeapon = null; punchSoundPlayed = false; }
public override bool Init(IKControl control, Transform p) { base.Init(control, p); boneLengths = new float[bdArr_data.Length - 1]; // Get the length of each bone for (int i = 0; i < bdArr_data.Length - 1; i++) { boneLengths[i] = (bdArr_data[i + 1].position - bdArr_data[i].position).magnitude; } // positionAccuracy = legLength*0.001f; return(true); }
/// <summary> /// Start is called on the frame when a script is enabled just before /// any of the Update methods is called the first time. /// </summary> void Start() { fpController = GetComponent <FirstPersonController>(); ikControl = GetComponentInChildren <IKControl>(); damageImage = GameObject.FindGameObjectWithTag("Screen").transform.Find("DamageImage").GetComponent <Image>(); healthSlider = GameObject.FindGameObjectWithTag("Screen").GetComponentInChildren <Slider>(); currentHealth = startingHealth; if (photonView.IsMine) { healthSlider.value = currentHealth; } damaged = false; isDead = false; isSinking = false; }
// Use this for initialization protected void Initialize() { pickup = false; inventory = new List <GameObject>(); maxInventorySize = 10; ammoInventorySize = 0; itemInventorySize = 0; currentInventorySize = 0; weapons = new GameObject[2]; ik = GetComponent <IKControl>(); anim = GetComponent <Animator>(); weaponManager = GetComponent <WeaponManager> (); characterStatus = gameObject.GetComponent <Status>(); //used for ignoring the character when raycasting in 3rd person // TODO mask = 1 << 8; mask = ~mask; //change to how many weapons in game ammo = new int[4]; // simply creating an empty game object to use for the slot objects rather than the Mixamo body parts // prefered to do it in code rather than on the prefabs GameObject helmetTemp = new GameObject(); helmetTemp.transform.position = helmetSlot.transform.position; helmetTemp.transform.rotation = helmetSlot.transform.rotation; helmetTemp.transform.SetParent(helmetSlot.transform); helmetSlot = helmetTemp; helmetSlot.name = "Helmet Slot"; GameObject backpackTemp = new GameObject(); backpackTemp.transform.position = backpackSlot.transform.position; backpackTemp.transform.rotation = backpackSlot.transform.rotation; backpackTemp.transform.SetParent(backpackSlot.transform); backpackSlot = backpackTemp; backpackSlot.name = "Backpack Slot"; GameObject vestTemp = new GameObject(); vestTemp.transform.position = vestSlot.transform.position; vestTemp.transform.rotation = vestSlot.transform.rotation; vestTemp.transform.SetParent(vestSlot.transform); vestSlot = vestTemp; vestSlot.name = "Vest Slot"; }
//Sets references public virtual void Awake() { thisAgent = GetComponent <NavMeshAgent>(); thisBody = GetComponent <Rigidbody>(); control = GetComponent <IKControl>(); if (PhotonNetwork.IsConnected) { if (!PhotonNetwork.IsMasterClient) { thisBody.constraints = RigidbodyConstraints.FreezeAll; Destroy(thisAgent); Destroy(this); } } }
private void GatherPlayerComponents() { playerController = GetComponentInChildren <PlayerController>(); weaponChargeCanvas = GetComponentInChildren <WeaponChargeCanvas>(); rb = GetComponentInChildren <Rigidbody>(); playerCam = GetComponentInChildren <PlayerCamera>(); entity = GetComponentInChildren <Entity>(); weaponSlot = GetComponentInChildren <WeaponSlot>(); helmetSlot = GetComponentInChildren <HelmetSlot>(); trinketSlot = GetComponentInChildren <TrinketSlot>(); myInventory = GetComponentInChildren <Inventory>(); dwarfAnimController = GetComponentInChildren <DwarfAnimationsScript>(); dwarfAnimEvents = GetComponentInChildren <AnimationEventsDwarf>(); iKControl = GetComponentInChildren <IKControl>(); playerAppearance = GetComponentInChildren <PlayerAppearance>(); reviveZone = GetComponentInChildren <ReviveZone>(); cameraShake = GetComponentInChildren <CameraShake>(); }
private VmdIKFrame ReadIKFrame() { var frame = new VmdIKFrame(); frame.FrameIndex = _reader.ReadInt32(); frame.Visible = _reader.ReadBoolean(); var ikCount = _reader.ReadInt32(); var iks = new IKControl[ikCount]; for (var i = 0; i < ikCount; ++i) { iks[i] = ReadIKControl(); } frame.IKControls = iks; return(frame); }
// Use this for initialization void Start() { Wilson = GameObject.Find ("Wilson"); Diana = GameObject.Find ("Diana"); animator = Wilson.GetComponent<Animator> (); relationTracker = GameObject.Find ("BehaviorController").GetComponent<RelationTracker> (); eventManager = GameObject.Find ("BehaviorController").GetComponent<EventManager> (); leftGrasper = animator.GetBoneTransform (HumanBodyBones.LeftHand).transform.gameObject; rightGrasper = animator.GetBoneTransform (HumanBodyBones.RightHand).transform.gameObject; graspController = Wilson.GetComponent<GraspScript> (); ikControl = Wilson.GetComponent<IKControl> (); leftTarget = ikControl.leftHandObj.GetComponent<IKTarget> (); rightTarget = ikControl.rightHandObj.GetComponent<IKTarget> (); headTarget = ikControl.lookObj.GetComponent<IKTarget> (); outputModality = GameObject.Find ("OutputModality").GetComponent<OutputModality>(); goBack = false; currentStep = DemoStep.Step0; waitTimer = new Timer (WAIT_TIME); waitTimer.Enabled = false; waitTimer.Elapsed += Proceed; humanMoveComplete = false; leftAtTarget = false; rightAtTarget = false; eventManager.EventComplete += HumanMoveComplete; leftTarget.AtTarget += LeftAtTarget; rightTarget.AtTarget += RightAtTarget; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ikControl = GameObject.FindGameObjectWithTag ("Animator").GetComponent<IKControl> (); ikControl.movement = 1; timer = 0; }