private void UpdateMouth(FaceTarget faceTarget) { Mouth mouth = faceTarget.mouth; UpdateFacePoint(faceTarget, mouth.upperLip); UpdateFacePoint(faceTarget, mouth.lipLeft); UpdateFacePoint(faceTarget, mouth.lipRight); UpdateFacePoint(faceTarget, mouth.lowerLip); //if (mouth.upperLipLeft.target.confidence.position < 0.1F) // LerpMouthPoint(mouth, mouth.upperLipLeft, mouth.upperLip, mouth.lipLeft, 0.3F); //else UpdateFacePoint(faceTarget, mouth.upperLipLeft); //if (mouth.upperLipRight.target.confidence.position < 0.1F) // LerpMouthPoint(mouth, mouth.upperLipRight, mouth.upperLip, mouth.lipRight, 0.3F); //else UpdateFacePoint(faceTarget, mouth.upperLipRight); //if (mouth.lowerLipLeft.target.confidence.position < 0.1F) // LerpMouthPoint(mouth, mouth.lowerLipLeft, mouth.lowerLip, mouth.lipLeft, 0.3F); //else UpdateFacePoint(faceTarget, mouth.lowerLipLeft); //if (mouth.lowerLipRight.target.confidence.position < 0.1F) // LerpMouthPoint(mouth, mouth.lowerLipRight, mouth.lowerLip, mouth.lipRight, 0.3F); //else UpdateFacePoint(faceTarget, mouth.lowerLipRight); }
public Form1() { InitializeComponent(); this.toolStripMenuVoiceSelector.Text = Qlasha.Properties.Resources.MenuStrVoice; this.volumeToolStripMenuItem.Text = Qlasha.Properties.Resources.MenuStrVolume; this.rateToolStripMenuItem.Text = Qlasha.Properties.Resources.MenuStrRate; this.lastMessageToolStripMenuItem.Text = Qlasha.Properties.Resources.MenuStrLastMessage; this.exitToolStripMenuItem.Text = Qlasha.Properties.Resources.MenuStrExit; this.brainToolStripMenuItem.Text = Qlasha.Properties.Resources.MenuStrBrowser; try { this.Opacity = Convert.ToDouble(Qlasha.Properties.Resources.CfgOpacityTransparent); } catch { }; LastMouseHoverTime = DateTime.Now; LastMouseMoveTime = DateTime.Now; LastMouseDownTime = DateTime.Now; LastMouseUpTime = DateTime.Now; QlashaMemory = new Memory(); QlashaMouth = new Mouth(QlashaMemory); ListeNet = new HTTP(Qlasha.Properties.Resources.CfgHTTPProtocol, Qlasha.Properties.Resources.CfgHTTPHosts.Split(new string[] { Qlasha.Properties.Resources.CfgSeparator }, System.StringSplitOptions.RemoveEmptyEntries), Qlasha.Properties.Resources.CfgHTTPPort, Qlasha.Properties.Resources.StrErrorInitHTTP, QlashaMouth, QlashaMemory); ListeNet.NewMessage += new MessageEventHandler(ListeNet_NewMessage); }
private void Awake() { mouth = GetComponent <Mouth>(); leg = GetComponentInParent <Leg>(); animator = GetComponent <Animator>(); GetComponent <BasicInformation>().IamSpeacial(); }
public Manager(frmMain mainForm) { m_mainForm = mainForm; m_eyes = new Eyes(this); m_hands = new Hands(); m_ears = new Ears(this); m_mouth = new Mouth(m_mainForm); m_legs = new Legs(); m_actualState = FishingState.Stopped; m_neededActions = NeededAction.None; m_fishingStats.Reset(); //InitializeTimer(Timer, Handler); InitializeTimer(ref m_nextActionTimer, TakeNextAction); InitializeTimer(ref m_LureTimer, LureTimerTick); InitializeTimer(ref m_CharmTimer, CharmTimerTick); InitializeTimer(ref m_RaftTimer, RaftTimerTick); InitializeTimer(ref m_BaitTimer, BaitTimerTick); InitializeTimer(ref m_HearthStoneTimer, HearthStoneTimerTick); InitializeTimer(ref m_AntiAfkTimer, AntiAfkTimerTick); ResetTimers(); }
// Use this for initialization void Awake() { current = this; leg = GetComponentInParent <Leg>(); mouth = GetComponent <Mouth>(); animator = GetComponent <Animator>(); }
public Manager(IManagerEventHandler managerEventHandler, IProgress <string> progressHandle) { m_managerEventHandler = managerEventHandler; m_eyes = new Eyes(); m_hands = new Hands(); m_ears = new Ears(); m_mouth = new Mouth(progressHandle); m_legs = new Legs(); m_fishingState = FishingState.Stopped; m_neededActions = NeededAction.None; m_fishingStats = new FishingStats(); m_fishingStats.Reset(); _cancellationTokenSource = null; InitializeTimer(ref m_LureTimer, LureTimerTick); InitializeTimer(ref m_CharmTimer, CharmTimerTick); InitializeTimer(ref m_RaftTimer, RaftTimerTick); InitializeTimer(ref m_BaitTimer, BaitTimerTick); InitializeTimer(ref m_HearthStoneTimer, HearthStoneTimerTick); InitializeTimer(ref m_AntiAfkTimer, AntiAfkTimerTick); ResetTimers(); }
private void SpawnCreature(JointGenerator generator) { var pos = new Vector3( x: _size.xMin + Random.value * _size.width, y: 3, z: _size.yMin + Random.value * _size.height ); var rootObject = generator.Instantiate(pos); var centralBody = rootObject.transform.GetChild(0).gameObject; Sensor.CreateComponent(centralBody, typeof(Food), State.BasicKeys.RelativeFoodPosition, range: 100f); var mouth = Mouth.CreateComponent(centralBody, typeof(Food)); var actions = LocomotionAction.EightDirections(); var sequenceMaker = new EvolutionarySequenceMaker(epsilon: 0.3f, minimumCandidates: 30); var brain = new Brain( new FollowPointDecisionMaker(State.BasicKeys.RelativeFoodPosition), sequenceMaker ); var agent = Agent.CreateComponent(rootObject, brain, new Body(rootObject), actions); agent.name = RandomName(); var info = GameUI.AddAgent(agent); StartCoroutine(EntryPointUtility.Rename(info, agent, mouth)); }
static void Main(string[] args) { // CheckSenses senses; // AbstractClass // CheckPlayer player; // AbstractClass ICheckSenses senses; // Interface ICheckPlayer player; // Interface Console.Clear(); Console.WriteLine("---------------------------------------------"); Console.WriteLine(" SELAMAT DATANG DI SWORD ART ONLINE"); Console.WriteLine("---------------------------------------------"); Console.WriteLine(); senses = new Brain(); senses.Notification(); senses = new Nose(); senses.Notification(); senses = new Eyes(); senses.Notification(); senses = new Ears(); senses.Notification(); senses = new Mouth(); senses.Notification(); senses = new Touch(); senses.Notification(); Console.WriteLine(); player = new Player1(); player.Notification(); Console.ReadKey(); }
public static IEnumerator Rename(CreatureInfoCell cell, Agent agent, Mouth mouth) { while (true) { yield return(new WaitForSeconds(10)); cell.DisplayName = agent.name + ":" + mouth.EatenCount; } }
private void InstantiateMouth(string currentKey) { Mouth mouth = mouthDictionary[currentKey]; _mouthInstance = Instantiate(_mouthPrefab, mouth.MouthPosition, Quaternion.identity); _mouthInstanceKey = currentKey; _mouthInstance.name = _mouthInstanceKey; _mouthInstance.GetComponent <SpriteRenderer>().sprite = mouth.MouthSprite; }
private void Awake() { mouthScript = GameObject.Find("Mouth").GetComponent <Mouth>(); Assert.IsNotNull(mouthScript, "Failed to access to mouthScript"); color = GetComponent <SpriteRenderer>(); Assert.IsNotNull(color, "Failed to find Color component."); Color currentColor = color.color; }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; playerPos = new Vector4(0, 0, 0, 0); fadeDistance = 40; edgeSoftness = 0.01f; mouthScript = GameObject.Find("BatMouth").GetComponent <Mouth>(); target = player; }
/// <summary> /// Creates a new database and adds in default entities /// </summary> public EntityDefinitionDatabase() { AddDefinition("DefaultEye", Eye.GetEye(Color.White).ToDefinition()); AddDefinition("DefaultFood", FoodPellets.GetFoodPellet(Color.White).ToDefinition()); AddDefinition("DefaultMouth", Mouth.GetMouth(Color.White).ToDefinition()); AddDefinition("DefaultNose", Nose.GetNose(Color.White).ToDefinition()); AddDefinition("DefaultWeapon", Weapon.GetWeapon(Color.White).ToDefinition()); AddDefinition("Soupling", Soupling.GetCritter(Color.White).ToDefinition()); }
//吹き出し画像の生成 r:基準サイズ Mouth:スピーカ位置 private Image CreateNozzle(int r, Mouth mouth) { return(new Image { //画像ファイルは、スピーカ位置によって左右を使い分ける Source = mouth == Mouth.Left ? "nozzleWhite.png" : "nozzleLime.png", WidthRequest = r, //基準サイズで初期化される HeightRequest = r }); }
public Face() { Head = new Head(); Hair = new Hair(); Eyebrows = new Eyebrow[2]; Eyes = new Eye[2]; Nose = new Nose(); Mouth = new Mouth(); }
public void Eat(Mouth _mouth) { MouthEatingThis = _mouth; CurrentState = StateEnum.BeingEaten; StartEatTime = Time.time; EatenScaleStart = new Vector2(Mass, Mass); EatenPositionStart = transform.position; EatenTarget = _mouth.transform; MyRigidBody.simulated = false; }
public HumanFeatures(Mouth nmouth, Eyes neyes, Hair nhair, Ear near, Nose nnose) { mouth = nmouth; eyes = neyes; hair = nhair; ear = near; nose = nnose; code = ((int)mouth).ToString() + ((int)eyes).ToString() + ((int)hair).ToString() + ((int)ear).ToString() + ((int)nose).ToString(); // return this; }
//扇形画像の生成 r:基準サイズ int:回転角度 Mouth:スピーカ位置 private Image CreateSector(int r, int rotation, Mouth mouth) { return(new Image() { //画像ファイルは、スピーカ位置によって緑と白を使い分ける Source = mouth == Mouth.Left ? "sectorWhite.png" : "sectorLime.png", Rotation = rotation, //配置に応じて画像を回転させる WidthRequest = r, //基準サイズで初期化される HeightRequest = r }); }
void CounterAttack() { CurrentState = StateEnum.Default; Time.timeScale = 1; MyRigidBody.simulated = true; SetMass(Mathf.Max(PlanetSpawner.PLANET_SIZE_MIN, Mass * 0.5f)); PlanetSpawner.Instance.RemovePlanetFromGame(MouthEatingThis.MyMassObject); MouthEatingThis = null; Instantiate(ExplosionParticles, transform.position, Quaternion.identity); }
void Awake() { if (CharacterInstance == null && GetComponent <CharacterMover>() != null) { CharacterInstance = this; } MyRigidBody = GetComponent <Rigidbody2D>(); MyRenderer = GetComponent <Renderer>(); MyMouth = GetComponent <Mouth>(); audio = GetComponent <AudioSource>(); }
protected virtual void UpdateMouth(Mouth mouth) { mouth.upperLip.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.upperLip.target.position); mouth.upperLipLeft.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.upperLipLeft.target.position); mouth.upperLipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.upperLipRight.target.position); mouth.lipLeft.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lipLeft.target.position); mouth.lipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lipRight.target.position); mouth.lowerLip.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lowerLip.target.position); mouth.lowerLipLeft.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lowerLipLeft.target.position); mouth.lowerLipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lowerLipRight.target.position); }
public Boolean verifyMouth(Mouth mouth, List <Mouth> mouths) { Boolean exists = false; foreach (Mouth mo in mouths) { if (mo == mouth) { exists = true; } } return(exists); }
void StopWaitCounterAttack() { CurrentState = StateEnum.Default; Time.timeScale = 1; MouthEatingThis = null; MyRigidBody.simulated = true; SetMass(Mathf.Max(PlanetSpawner.PLANET_SIZE_MIN, Mass * 0.5f)); // volcano! MyRigidBody.velocity = new Vector2(VOLCANO_SPEED * (Random.value * 2 - 1), VOLCANO_SPEED * (Random.value * 2 - 1)); CurrentState = StateEnum.Volcano; timeAtStartWaitVolcano = Time.time; }
private void LerpMouthPoint(Mouth mouth, FaceBone mouthBone, FaceBone mouthBone1, FaceBone mouthBone2, float f) { if (mouthBone.bone.transform == null || mouthBone1.target.confidence.position < 0.1F || mouthBone2.target.confidence.position < 0.1F) { return; } Vector3 localPosition1 = mouthBone1.target.transform.localPosition - mouthBone1.startPosition; Vector3 localPosition2 = mouthBone2.target.transform.localPosition - mouthBone2.startPosition; Vector3 localPosition = Vector3.Lerp(localPosition1, localPosition2, f); mouthBone.target.transform.localPosition = mouthBone.startPosition + localPosition; UpdateFacePoint(faceTarget, mouthBone); }
void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; step = 0; mouth = this.gameObject.transform.GetChild(0).gameObject; mouthScript = mouth.GetComponent <Mouth>(); body = this.gameObject.transform.GetChild(1).gameObject; bodyScript = body.GetComponent <Body>(); eyes = this.gameObject.transform.GetChild(2).gameObject; eyesScript = eyes.GetComponent <Eyes>(); LoadText(); LoadButtons(); HideAllButtons(); StartCoroutine(InitGame()); }
private void Awake() { if (instance == null) { instance = this; } else { throw new System.Exception("Duplicate player manager found"); } health = GetComponent <Health>(); growth = GetComponentInChildren <Growth>(); mouth = GetComponentInChildren <Mouth>(); movement = GetComponent <Movement>(); }
//private float conservativeMultiplier = 1.5f; void Awake() { movement = GetComponent<Movement>(); mouthScript = GetComponentInChildren<Mouth>(); playerInfo = GetComponent<PlayerInfo>(); // Get the physical collider (not the trigger) CircleCollider2D[] circleColliders = GetComponents<CircleCollider2D>(); foreach (CircleCollider2D cc in circleColliders) { if (!cc.isTrigger) { circleCollider = cc; break; } } if (loadFromFile) LoadNetFromFile(); }
public override void Awake() { base.Awake(); if (mouths == null) { mouths = new Mouth[2] { new Mouth() { Name = "C1" }, new Mouth() { Name = "C2" } } } ; } }
private static void MouthInspector(Mouth mouth) { showMouth = EditorGUILayout.Foldout(showMouth, "Mouth", true); if (showMouth) { EditorGUI.indentLevel++; FaceBoneInspector("Upper Lip Left", mouth.upperLipLeft); FaceBoneInspector("Upper Lip", mouth.upperLip); FaceBoneInspector("Upper Lip Right", mouth.upperLipRight); FaceBoneInspector("Left Lip Corner", mouth.lipLeft); FaceBoneInspector("Right Lip Corner", mouth.lipRight); FaceBoneInspector("Lower Lip Left", mouth.lowerLipLeft); FaceBoneInspector("Lower Lip", mouth.lowerLip); FaceBoneInspector("Lower Lip Right", mouth.lowerLipRight); EditorGUI.indentLevel--; } }
private GameObject SpawnCreature() { var rootObject = GameObject.CreatePrimitive(PrimitiveType.Cube); SuperFlexibleMove.CreateComponent(rootObject, speed: 1f); rootObject.AddComponent <Rigidbody>().freezeRotation = true; rootObject.GetComponent <Renderer>().material.color = Color.red; Sensor.CreateComponent(rootObject, typeof(Food), State.BasicKeys.RelativeFoodPosition, range: 100f); Mouth.CreateComponent(rootObject, typeof(Food)); var actions = LocomotionAction.EightDirections(); var sequenceMaker = new EvolutionarySequenceMaker(epsilon: 0.3f, minimumCandidates: 30); var brain = new Brain( new FollowPointDecisionMaker(State.BasicKeys.RelativeFoodPosition), sequenceMaker ); Agent.CreateComponent(rootObject, brain, new Body(rootObject), actions); return(rootObject); }