public override void Start() { Chad = gameObject.GetComponent <ChadControls>(); if (Skin != null) { if (Animations.Count > 0) { foreach (var state in Animations) { if (state.Key != ChadControls.STATE.RAGDOLL) // No Ragdoll animations { BlendNode newBlendNode = new BlendNode(Skin.model); for (int i = 0; i < state.Value.Count; ++i) { if (state.Key == ChadControls.STATE.THROWING) { state.Value[i].Node = newBlendNode.appendNode(state.Value[i].Animation, false); } else { state.Value[i].Node = newBlendNode.appendNode(state.Value[i].Animation, true); } } BlendNodes.Add(state.Key, newBlendNode); WeightHandle newWeightHandle = BlendNodes[state.Key].generateWeightHandle(); WeightHandles.Add(state.Key, newWeightHandle); } } WeightHandles[ChadControls.STATE.CHADING].setWeight(0, new WeightTripple(1f)); Skin.setBlendTreeNode(BlendNodes[ChadControls.STATE.CHADING]); } } }
public override void Start() { //Blabla initial setup BlendNode blend = new BlendNode(skinn.model); foreach (var node in nodes) { blend.appendNode(node.animation, true); } weight = blend.generateWeightHandle(); skinn.setBlendTreeNode(blend); }